Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MOTION-157

...

Javadoc resource link
rangeHigherVersion6.0
classNameinfo.magnolia.ui.form.field.definition.RichTextFieldDefinition
renderTypeasynchronous
renders a rich text editor. This is a custom Magnolia field that implements the CKEditor component.

class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition

fieldType: richText

Image Modified

Table of Contents

...

Simple rich text field definition.:

Text
Editor
Localtab Group
Localtab
activetrue
titleYAML file
Code Block
languagejs
form:
  tabs:
    - name: tabText
      label: Text
      fields:
        - name: text
          fieldType: richText
          tables: true
          height: 500
          label: Text 
Editor
Localtab
titleJCR node
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

Node name

Value

Mgnl n
form

Mgnl n
tabs

Mgnl n
tabText

Mgnl n
fields

Mgnl n
text

Mgnl p
fieldType

richText

Mgnl p
tables

true

Mgnl p
height

500

Mgnl p
label

Include Page
_referencing Referencing fields shortcut info - 5 UI
_referencing Referencing fields shortcut info - 5 UI

Field-specific properties:

alignment

optional, default is false

Text alignment for paragraphs. When set to true, this option adds alignment buttons (left, center, right, justify) in the toolbar.

colors

optional

Colors displayed in the color selectors. Comma-separated a string of hexadecimal color codes without the # prefix, for example 00923E,F8C100,28166F . See CKEditor documentation for more.

configJsFile

optional

Location of a custom CKEditor configuration file, e.g. /.resources/ckeditor/config-magnolia.js. You can link to a file in the resources workspace, filesystem or classpath. See Origins and loading order for more. 

The default configuration files can be found in magnolia-ui-framework/src/main/resources/mgnl-resources/ckeditor/ 

  • config-magnolia.js (Git): Magnolia default configuration file.
  • config-default.js (Git): CKEditor configuration file.

(warning) If you use a custom configuration file Magnolia will ignore all other configured properties.

A custom configuration allows you control over the config.extraPlugins setting, but also means you need to the magnolialink and magnoliaFileBrowser plugins into your file. See the default config-magnolia.js for how to include the plugins.

fonts

optional

List of font names displayed in the Font selector in the toolbar, for example Arial/Arial,sans-serif;Times New Roman/Times New Roman,serif . Separate entries with a  semi-colon (;). 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. See

CKEditor documentation for more.

fontSizes

optional

List of fonts size displayed in the Font selector in the toolbar, for example 16/16px;24/24px;48/48px. Separate entries with a semi-colon (;). Any CSS-supported size can be used: 12px, 2.3em, 130%, larger or x-small. A display name may be optionally defined by prefixing the entries with the name and the slash character. For example, Bigger Font/14px will be displayed as Bigger Font in the list, but will be outputted as 14px. See CKEditor documentation for more.

height

optional, default is 300

The height of the editing area, including the toolbar, for example 500. This configuration option accepts an integer (to denote a value in pixels) or any CSS-defined length unit except percent (%) values.

images

optional, default is false

Allows images to be added from the DAM. When set to true, this option adds an image button in the toolbar. A user can define the size and alignment of the image, and some metadata.

lists

optional, default is true

Allows bulleted and numbered lists. When set to false, this option removes list buttons from the toolbar.

source

optional, default is false

Allows toggling between text and HTML editing. When set to true, this option adds a source button to the toolbar.

tables

optional, default is false

Allows tables to be added. When set to true, this option adds a tables button in the toolbar.

Common field properties:

Include Page
_Common field properties - 5 UI
_Common field properties - 5 UI

Link buttons

There are three link buttons:

...