How to use roles to guide editing behavior
An introduction to the how roles play a key part in your configuration.
Roles in the configuration can be used to configure the behavior of certain elements, configure buttons on the toolbar, tell Content Editor what to do when content is pasted, and to create more clarity in the user interface by using recognizable icons for actions regarding these elements.
The paragraph role is the most simple role to explain. This roles does a number of things:
- An element that is configured with role paragraph will be inserted into a section for example which has a <
choice> schema declaration for different children (a paragraph, list and table for example). Paragraph will behave like a default element for the choice. - The element will also receive a paragraph icon (¶) in the editor's interface.
Similarly lists need to be configured to show list behavior.
There are a few roles that have a special function. One of those is hidden-from-ui: This role hides elements and attributes from the interface. This can be used for example to hide database ID attributes on pages in the attributes dialog, or not show a choice for a child element in the menus.
Another special role is auto-insert, which can be used to mark elements as default choices for <sequence> or <choice> XML Schema declarations.