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="VIEW_NAME"> <ext:control id="CONTEXTMENU_ITEM" /> </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).- Experience Manager context menu
-
To add the menu item to the context menu that end users see when they edit a Web page, replace VIEW_NAME with
EditorViewand replace CONTEXTMENU_NAME withEditorContextMenu. - Content Manager Explorer context menu
-
To add the menu item to the context menu of the Content Manager Explorer user interface, replace VIEW_NAME with
DashboardViewand replace CONTEXTMENU_NAME withDashboardContextMenu.