<menuItem> Configuration Element

This element specifies an item to include within a menu in Ephox EditLive! for XML.

Configuration Element Tree Structure

<editLive>
     ...
     <menuBar>
          <menu>
               <menuItem ... />
          </menu>
     </menuBar>
     ...
</editLive>

Required Attributes

name

This attribute gives the name for the menu item. For use within a <menu> element it must be from the Menu and Toolbar Button Items command collection.

EditLive! for XML also has many XML specific menu and toolbar button items. A list of these is provided in the EditLive! for XML Specific Menu and Toolbar Button Items article.

In <submenu> items this attribute provides the value of the attribute. It should correspond to the name or size of the relevant font or the value for the style. The value used for this attribute will be inserted into the HTML source of the document when the submenu item is selected.

Optional Attributes

text

This attribute customizes the menu command text.

imageURL

This attribute changes the image associated with a menu item.

mnemonic

This attribute is a single letter which provides the mnemonic for the menu item.

Examples

The following example demonstrates how to add the mnuUndo, mnuRedo, mnuCut, mnuPaste, mnuSelectAll and mnuFind items to the Edit menu. Thus the instance of EditLive! for XML using this configuration will have only an Edit menu with these items.

<editLive>
    ...
    <menuBar>
        <menu name="Edit">
            <menuItem name="Undo"/>
            <menuItem name="Redo"/>
            <menuItem name="Cut"/>
            <menuItem name="Copy"/>
            <menuItem name="Paste"/>
            <menuItem name="SelectAll"/>
            <menuItem name="Find"/>
        </menu>
    </menuBar>
    ...
</editLive> 

The following example demonstrates how to add the Times New Roman, Courier New and Arial fonts to the mnuFontFace <submenu>. They will be listed as the New Roman, Courier and Company Default fonts respectively, in the submenu due to their text attributes

<editLive>
    ...
    <menuBar>
        <menu name="Format">
            <submenu name="FontFace">
                <menuItem name="Times New Roman" text="New Roman"/>
                <menuItem name="Courier New" text="Courier"/>
                <menuItem name="Arial" text="Company Default"/>
            </submenu>
        </menu>
    </menuBar>
    ...
</editLive> 

Remarks

The <menuItem> element can appear multiple times within the <menu> element.

The <menuItem> element must be a complete tag, it cannot contain a tag body. Therefore the tag must be closed in the same line. See the example below:

<menuItem name=... />

See Also