Documentation Center

Leverage built-in editor behavior with role mapping

Role mapping can help you create a customized editing experience.

A role mapping in your configuration connects a schema element to one of the predefined roles in Content Editor . Roles provide access to built-in behavior and can provide several features:
  • Configuration of the conventional toolbar buttons for text formatting, lists, and inserting images and tables.
  • Behavior when pressing keys, e.g. Enter and Shift-Enter.
  • Default insert behavior of elements from ‘choice’ schema definitions using the auto-insert role
  • A cleaner interface by hiding elements and attributes from the Content Editor interface.
Role mappings are defined in an <x:node> directive for each element or attribute that should have a role. This example maps the <p> element in the XML Schema to the paragraph role. This role supplies the behavior of appending a new paragraph-like element when a user presses the Enter key:
<x:nodeConfig>
<x:node match="p">
<x:role>paragraph</x:role>
...
</x:node>
...
</x:nodeConfig>