Configuration Reference

YAML Configuration Reference

When configuring the CKEditor using YAML, these are the property names that are currently used:

processing

Configuring transformations kicks in the RteHtmlParser API of TYPO3, to only allow certain HTML tags and attributes when saving the database or leaving the database to the RTE. However, defining transformations towards RTE is not really necessary anymore. Defining more strict processing options when storing content in the database also needs to be ensured that CKEditor allows this functionality too.

This configuration option was previously built within RTE.proc and can still be overridden via Page TSconfig. Everything defined via “processing” is available in RTE.proc and triggers RteHtmlParser options.

editor

Editor contains all RTE-specific options. All CKEditor-specific options, which one could imagine are available under “config” property and handed over to CKEditor’s instance-specific config array.

All other sub-properties are usually handled via TYPO3 and then injected in the CKEditor instance at runtime. This is useful for registering extra plugins, like the TYPO3 core does with a custom typo3-link.js plugin, or adding third-party plugins like handling images.

editor.config

editor.config

Configuration options For a list of all options see https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html

editor.config.language

defines the editor’s UI language, and is dynamically calculated (if not set otherwise) by the backend users’ preference.

editor.config.contentsLanguage

defines the language of the data, which is fetched from the sys_language information, but can be overridden by this option as well. For referencing files, TYPO3's internal "EXT:" syntax can be used, for using language labels, TYPO3's "LLL:" language functionality can be used.

editor.config.contentsCss

defines the location of one or multiple CSS file(s) of the editor, containing the style definitions that will be applied to the backend editor RTE element.

Example with single file:

editor.config.contentsCss:
  - "EXT:rte_ckeditor/Resources/Public/Css/contents.css"
Copied!

This is the default, as defined in EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml (GitHub).

Example with multiple files:

editor.config.contentsCss:
  - "EXT:rte_ckeditor/Resources/Public/Css/contents.css"
  - "EXT:my_sitepackage/Resources/Public/Css/contents.css?v=2"
Copied!

Since the CKEditor element is rendered within the page content of the TYPO3 backend (and not in an iframe or web-component), all CSS declarations in that file must refer to an actual element hierarchy ending like #data_tt_content__2687__bodytext_ckeditor5 .ck-content. To achieve this, TYPO3 automatically parses the contents of the CSS file with a process called "auto-prefixing" (via JavaScript, client-side) and converts all references to that "virtual" root hierarchy.

A CSS declaration like :root { background-color: green } gets turned into #data_tt_content__2687__bodytext_ckeditor5 .ck-content { background-color: green; }.

You can use a :root { ... } declaration, for example to reset relative/absolute sizes to ensure the CKEditor area being compatible to your usual frontend CSS. Also using body {...} is viable.

editor.config.heading

Defines headings available in the heading dropdown.

Example:

heading:
  options:
    - { model: 'heading2', view: 'h2', title: 'Heading 2' }
    - { model: 'heading3', view: 'h3', title: 'Heading 3' }
    - { model: 'heading4', view: 'h4', title: 'Heading 4' }
Copied!

It is also possible to set a class for a heading by default (for example, <h2 class="h2">):

heading:
  options:
     - { model: 'heading2', view: { name: 'h2', classes: 'h2' }, title: 'Heading 2' }
     - { model: 'heading3', view: { name: 'h3', classes: 'h3' }, title: 'Heading 3' }
     - { model: 'heading4', view: { name: 'h4', classes: 'h4' }, title: 'Heading 4' }
Copied!

To be able to reset a heading to a paragraph, add also the paragraph option:

heading:
  options:
     - { model: 'paragraph', title: 'Paragraph' }
     - { model: 'heading2', view 'h2', title: 'Heading 2' }
     # ...
Copied!

A title can also be localized with LLL:EXT:....

editor.config.style

Defines styles available in the style dropdown.

Example:

style:
  definitions:
    - { name: "Lead", element: "p", classes: ['lead'] }
    - { name: "Multiple", element: "p", classes: ['first', 'second'] }
Copied!
editor.config.importModules

Imports custom CKEditor plugins. See EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml (GitHub) or How do I create a custom plugin? for examples.

Page TSconfig

We recommend you to put all configurations for the preset in the YAML configuration. However, it is still possible to override these settings through the page TSconfig.

You can find a list of configuration properties in the Page TSconfig reference, chapter RTE.