RichTextFieldDefinition renders a rich text editor. This is a custom Magnolia field that implements the CKEditor component.
Here is the generic rich text field definition from the Standard Templating Kit. It is used in the
stkTextImage component in the Pages app.
You can use all common field properties and the following. Some of these features require at least Magnolia 5.2.2.
Text alignment for paragraphs. When set to
Colors displayed in the color selectors. Comma-separated a string of hexadecimal color codes without the
Location of a custom CKEditor configuration file. You can link to a file in the
Starting with 5.3.4 we provide the following configurations:
The custom configuration file will make Magnolia ignore all other configured properties.
If you use a custom configuration files you have control over the
List of font names displayed in the Font button in the toolbar. Entries are separated by semi-colons (;). It's possible to have more than one font for each entry separated by comma.
A display name may be optionally defined by prefixing the entries with the name and the slash character.
|List of fonts size displayed in the Font button combo in the toolbar. Entries are separated by semi-colons (';').|
Any CSS-supported size can be used:
A display name may be optionally defined by prefixing the entries with the name and the slash character. For example,
The height of the editing area that includes the editor content. This configuration option accepts an integer (to denote a value in pixels) or any CSS-defined length unit except percent (%) values.
Users can expand the editor content area to the full height of the container, typically a subapp.
Allows adding images from the DAM. When set to
Allows to add bulleted and numbered lists. When set to
Allows toggling CKEditor to view/edit content as plain HTML. When set to
|Allows adding tables. When set to |
For a change history see CKEditor integration in Magnolia 5.
There are three link buttons:
- Links to external pages
- Links to internal pages
- Links to documents in the DAM
Loading order for custom configuration
Note that any configuration done in a
will override configuration settings from the config.js file. This is why we ignore other properties in the field definition as soon as a
configJsFile is configured.