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

  1. Open the configuration file of your custom Editor in a plain-text or XML editor.
  2. In the extensions section, locate the ext:contextmenus section. Inside this section, create or find an <ext:add> element.
  3. For each menu item you want to add to a context menu, insert an ext:extension element 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:view identifies 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).