Documentation Center

Elements in a menuitems section in BehaviorConfig.xml

A menuitems section specifies custom (top) menu items.

menuitems
The element that can be used to add additional menu items to the Custom tab. You can insert a menuitems child element within the following behavior elements:
  • definitiontable
  • list
  • image
  • inline
  • highlighting
  • block
  • title
  • sheetbody
menuitem
The element that defines an additional menu item. It can contain the following child elements:
  • a required label child element
  • either an inserttemplate or a toggletemplate child element
menuitem can also have the following optional attributes:
  • xpath, to be used, for example, for adding a row in a table cell (if the attribute value is self::tgroup)
  • id, to be used in the future to allow referencing from a menu structure.
Here is an example menuitem element:
<menuitem id="insert_paragraph">
  <label>Insert paragraph</label>
  <inserttemplate>
    <p/>
  </inserttemplate>
</menuitem>
label
The label of the menu item.
inserttemplate
Use this element to specify a certain XML structure (provided within the inserttemplate element), to inserted below the current element or below the ancestor element specified in the xpath attribute of the menuitem element.
An optional specialbehavior attribute with value repositoryimageselector can be used to specify that you want to pick an image using a Repository browse dialog.
Typically, you would use insert templates for all elements that allow a menuitems child element, except for the inline and highlighting elements.
Here is an example of an inserttemplate element that inserts a definition list:
<inserttemplate>
  <dl>
    <dlhead>
      <dthd/>
      <ddhd/>
    </dlhead>
    <dlentry>
      <dt/>
      <dd/>
    </dlentry>
  </dl>
</inserttemplate>
And here is an example of an inserttemplate element that inserts an image, to be selected by the author:
<inserttemplate specialbehavior="showrepositoryimageselector">
  <image placement="break" href="{{reference}}"/>
</inserttemplate>
toggletemplate
Use toggletemplate to insert the specified XML element if no text is selected or to wrap or unwrap the currently selected text within the specified element.
The toggletemplate element has a required elementname attribute.
Typically, you would use a toggle template for inline or highlighting elements.
Here is an example of a toggletemplate element:
<toggletemplate elementname="keyword"/>