Adding a menu item to a context menu
Add a menu item to a context menu to give users an access point to existing or new functionality.
Procedure
- Open the configuration file of your custom Editor in a plain-text or XML editor.
- In the
extensionssection, locate theext:contextmenussection. Inside this section, create or find an<ext:add>element. - For each menu item you want to add to a context menu, insert an
ext:extensionelement that looks as follows:<ext:extension name="NewMenuItem" assignid="NewMenuItemID" insertbefore="cm_sep_1"> <ext:menudeclaration> <cmenu:ContextMenuItem id="MenuItemID" name="MenuItem" command="MenuItemCommand" /> <ext:menudeclaration> <ext:dependencies> <ext:dependency>MyCustomization.AllMyCommands</ext:dependency> </ext:dependencies> <ext:apply> <ext:view name="DashboardView"> <ext:control id="DashboardContextMenu" /> </ext:view> </ext:apply> </ext:extension>where MenuItemCommand refers to a command in one of your command sets.
The
ext:viewidentifies which context menu in which view the menu item should be added to (in this example, the item is added to the main context menu in the main Content Manager Explorer view).