Adding a separator or submenu to a context menu
Add a separator or a submenu to a context menu to set a group of related controls apart.
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 submenu 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 name="MenuItem" type="submenu"> </cmenu:ContextMenuItem> <ext:menudeclaration> <ext:apply> <ext:view name="VIEW_MENU"> <ext:control id="CONTEXTMENU_NAME" /> </ext:view> </ext:apply> </ext:extension>You can now add
cmenu:ContextMenuItemelements inside the newcmenu:ContextMenuItemelement to fill the submenu. - For each separator 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 name="MenuItem" type="separator" /> <ext:menudeclaration> <ext:apply> <ext:view name="VIEW_MENU"> <ext:control id="CONTEXTMENU_NAME" /> </ext:view> </ext:apply> </ext:extension>This inserts a separator at the position you specify.
- In all
ext:viewsections you created, specify the view name and context menu name as follows:- Experience Manager context menu
-
To add your submenu or separator 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 your submenu or separator to the context menu of the Content Manager Explorer user interface, replace VIEW_NAME with
DashboardViewand replace CONTEXTMENU_NAME withDashboardContextMenu.
- Save and close your Editor's configuration file.