TYPO3 RTE by CKEditor

Extension key

rte_ckeditor

Package name

typo3/cms-rte-ckeditor

Version

12.4

Language

en

Author

TYPO3 contributors

License

This document is published under the Open Content License.

Rendered

Tue, 08 Jul 2025 09:23:06 +0000


This extension integrates the CKEditor as a rich text editor into the TYPO3 backend.


Table of Contents:

Introduction

What does it do?

The extension rte_ckeditor provides a rich text editor (RTE) by integrating CKEditor 5 into TYPO3.

This makes it possible to use the features of CKEditor when editing rich text fields in the TYPO3 backend or frontend (if frontend editing is used). Rich text fields are fields which may contain text with markup, for example for adding a style such as bold, using lists or enumerations, headlines or adding links.

Editing a textfield in the backend with rte_ckeditor.

CKEditor is a WYSIWYG editor mostly written in JavaScript, and is used in many systems due to its flexibility. There are hundreds of free open-source plugins for CKEditor to enhance the editing experience.

History

Before TYPO3 v8, a custom fork of "HtmlArea", another open-source WYSIWYG editor was shipped with TYPO3 Core in a separate extension rtehtmlarea. "HtmlArea" isn't supported anymore since TYPO3 v9 LTS. You have to migrate to rte_ckeditor when upgrading from previous TYPO3 versions (=< v8).

CKEditor 4 was officially integrated as the default rich text editor in TYPO3 v8 LTS, within an extension called rte_ckeditor.

With TYPO3 v12, CKEditor 4 has been updated to CKEditor 5.

Features

The extension rte_ckeditor incorporates the features of CKEditor and adds additional functionality, configuration presets and plugins.

Some examples of features:

  • Configurable via YAML files
  • Configuration presets (minimal, default, full) for TYPO3
  • Toolbar customization
  • Link functionality: integration with TYPO3 link wizard
  • Wordcount: plugin that counts and shows the chars/words/paragraphs in the footer of the editor. It also supports limiting the max. amount of chars/words.

General Concepts

User interfaces

CKEditor has multiple user interfaces, of which TYPO3 uses the following:

Classic

Editing is done within a fixed container. It is possible to customize how the editor behaves and how the content is styled.

Used in the TYPO3 Backend.

Inline

All formatting styles are reused from the surrounding HTML and CSS styles, allowing for a seamless frontend editing.

Used by TYPO3’s frontend_editing, which can be found on GitHub. frontend_editing is not covered in this document.

For a demonstration of all user interfaces, see the CKEditor demo.

Installation

This extension is part of the TYPO3 Core.

Table of contents

Installation with Composer

Check whether you are already using the extension with:

composer show | grep rte
Copied!

This should either give you no result or something similar to:

typo3/cms-rte-ckeditor       v12.4.11
Copied!

If it is not installed yet, use the composer require command to install the extension:

composer require typo3/cms-rte-ckeditor
Copied!

The given version depends on the version of the TYPO3 Core you are using.

Installation without Composer

In an installation without Composer, the extension is already shipped but might not be activated yet. Activate it as follows:

  1. In the backend, navigate to the Admin Tools > Extensions module.
  2. Click the Activate icon for the RTE CKEditor extension.
Extension manager showing RTE CKEditor extension

Extension manager showing RTE CKEditor extension

Configuration

You can use the shipped configuration and everything will work as preconfigured (using the "default" preset).

Configuration Quickstart

Here we explain, how to modify the existing configuration in a few simple steps.

View Existing Configuration

To familiarize yourself with the configuration, look at the existing configuration in your TYPO3 website:

To view the existing RTE presets in the "Global Configuration", go to System > Configuration in the backend, choose $GLOBALS['TYPO3_CONF_VARS'] (Global Configuration) and select RTE:

Global Configuration: RTE > Presets

By default, TYPO3 is shipped with three configuration presets:

  • default
  • full
  • minimal

Minimal Example

Here is a very minimal example of changing the default configuration. All configuration is done in a custom sitepackage extension, see also Use a Sitepackage extension.

Override the configuration preset "default" by adding this in <my_extension>/ext_localconf.php (replace my_extension with your extension key):

$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:my_extension/Configuration/RTE/Default.yaml';
Copied!

Add the file Configuration/RTE/Default.yaml to your extension, use the file EXT:rte_ckeditor/Configuration/RTE/Full.yaml (GitHub) as example.

We explain the example Minimal.yaml from the Core:

EXT:rte_ckeditor/Configuration/RTE/Minimal.yaml
# Load default processing options
imports:
  - { resource: 'EXT:rte_ckeditor/Configuration/RTE/Processing.yaml' }
  - { resource: 'EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml' }

# Minimal configuration for the editor
editor:
  config:
    toolbar:
      items:
        - bold
        - italic
        - '|'
        - clipboard
        - undo
        - redo
Copied!
line #2
Imports existing files to make basic parts reusable and improve structure of configuration
line #9 toolbar
See toolbar

TYPO3 Configuration Basics

Just in case you are not familiar with how to configure TYPO3, we will give you a very brief introduction. Otherwise, you can safely skip this part and continue reading Configuration Concepts.

We only cover configuration methods that are used to configure rte_ckeditor.

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.

Relevant Settings for rte_ckeditor

Page TSconfig can be used to change:

  1. Default preset:

    RTE.default.preset = full
    Copied!
  2. Override for one field ( RTE.config.[tableName].[fieldName].preset):

    RTE.config.tt_content.bodytext.preset = myCustomPreset
    RTE.config.tx_news_domain_model_news.bodytext.preset = minimal
    Copied!
  3. Override for one field defined in flexform ( RTE.config.[tableName].[flexForm\.field\.name].preset):

    RTE.config.tt_content.settings\.notifications\.emailText.preset = myCustomPreset
    Copied!
  4. Override for one field, if type matches ( RTE.config.[tableName].[fieldName].types.[type].preset):

    RTE.config.tt_content.bodytext.types.textmedia.preset = minimal
    Copied!

How to change values

See the Page TSconfig reference, chapter Setting Page TSconfig. This chapter also expains how to verify the settings.

Global Configuration

Global Configuration is a system-wide general configuration.

Relevant Settings for rte_ckeditor

The setting $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets'] is used to configure the available presets for rich text editing.

By default, the presets "minimal", "default" and "full" are defined.

If you add a new preset, you must add it to this array.

How to change values

Usually, Global Configuration can be configured in the backend in Admin Tools > Settings > Configure Installation-Wide Options.

However, the settings relevant for rich text editing, $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets'] cannot be configured in the backend.

You must either configure this in:

  1. The file %config-dir%/system/additional.php
  2. Or in an extension in the file EXT:<extkey>/ext_localconf.php
if (empty($GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['myCustomPreset'])) {
    $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['myCustomPreset']
        = 'EXT:<extkey>/Configuration/RTE/MyCustomPreset.yaml';
}
Copied!

How to view settings

You can view the Global Configuration in System > Configuration > $GLOBAL['TYPO3_CONF_VARS'] (Global Configuration) > RTE.

Global Configuration: RTE > Presets

YAML

Most of the configuration of rte_ckeditor will be done in a YAML file.

Relevant Settings for rte_ckeditor

See Configuration Reference

How to change values

This is done directly in the file. The YAML file should be included in a sitepackage extension, see Use a Sitepackage extension.

Configuration Concepts

Configuration Overview

The main principles of configuring a Rich Text Editor in TYPO3 apply to editing with any Rich Text Editor (rte_ckeditor, ...).

Some of the functionality (for example the RTE transformations) is embedded in the TYPO3 core and not specific to rte_ckeditor.

There are three main parts relevant for rich text editing with TYPO3:

Editor configuration
This covers how the actual editor (in this case CKEditor) should behave, what buttons should be shown, what options are available.
RTE transformations
This defines how the information is processed when saved from the Rich Text Editor to the database. And when loaded from the database into the Rich Text Editor.
Frontend output configuration
The information fetched from the database may need to be processed for the frontend. The configuration of the frontend output is configured via TypoScript.

This section mainly covers editor configuration and RTE transformations, as for TypoScript the TypoScript reference handles output of HTML content and has everything preset (see parseFunc).

Editor Configuration

YAML

TYPO3 is using a custom YAML API for handling YAML in TYPO3 based on the Symfony YAML package. Therefore environment variables can be used.

YAML Basics

  • YAML is case sensitive
  • Indenting level reflects hierarchy level and indenting must be used consistently (indent with 2 spaces in rte_ckeditor configuration).
  • Comments begin with a #.
  • White space is important, use a space after :.

This is a dictionary (associative array):

key1: value
key2: value
Copied!

A dictionary can be nested, for example:

key1:
  key1-2: value
Copied!

This is a list:

- list item 1
- list item 2
Copied!

A dictionary can be combined with a list:

key:
  key2:
    - item 1
    - item 2
Copied!

Configuration Presets

Presets are the heart of having custom configuration per record type, or page area. A preset consists of a name and a reference to the location of a YAML file.

TYPO3 ships with three RTE presets, “default”, “minimal” and “full”. The "default" configuration is active by default.

It is possible for extensions to ship their own preset like “news”, or “site_xyz”.

Registration of a preset happens within system/config.php, system/additional.php or within ext_localconf.php of an extension:

$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default']
    = 'EXT:rte_ckeditor/Configuration/RTE/Default.yaml';
Copied!

This way, it is possible to override the default preset, for example by using the configuration defined in a custom extension:

$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default']
    = 'EXT:my_extension/Configuration/RTE/Default.yaml';
Copied!

TYPO3 uses the “default” preset for all Rich-Text-Element fields. To use a different preset throughout an installation or a branch of the website, see Overriding Configuration via page TSconfig.

Selecting a specific preset for bullet lists can be done via TCA configuration of a field. The following example shows the TCA configuration for the sys_news database table, which can be found in EXT:core/Configuration/TCA/sys_news.php.

'content' => [
    'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.text',
    'config' => [
        'type' => 'text',
        'cols' => 48,
        'rows' => 5,
        'enableRichtext' => true,
        'richtextConfiguration' => 'default',
    ],
],
Copied!

Enabling Rich Text Parsing itself is done via enableRichtext, and a specific configuration can be set via richtextConfiguration, setting it to for example “news”.

Overriding Configuration via page TSconfig

Instead of overriding all TCA fields to use a custom preset, it is possible to override this information via page TSconfig.

The option RTE.default.preset = news can also be set on a per-field and per-type basis:

EXT:my_sitepackage/Configuration/page.tsconfig
# per-field
RTE.config.tt_content.bodytext.preset = minimal

# per-type
RTE.config.tt_content.bodytext.types.bullets.preset = bullets
Copied!
line #2
This sets the "minimal" preset for all bodytext fields of content elements.
line #4
This sets the "bullets" preset for all bodytext fields of content elements, with Content Type “Bullet list” (CType=bullets).

Of course, any other specific option set via YAML can be overridden via Page TSconfig as well:

Specific options set via YAML can be overridden via page TSconfig as well - but be aware that boolean values can not be set, and arrays are not merged but overridden.

EXT:my_sitepackage/Configuration/page.tsconfig
# Restrict format_tags to h2 in bodytext field of content elements
RTE.config.tt_content.bodytext.editor.config.format_tags = h2
Copied!

The loading order for configuration is:

  1. preset defined for a specific field via PageTS
  2. richtextConfiguration defined for a specific field via TCA
  3. general preset defined via page TSconfig
  4. default

For more examples, see RTE in "TSconfig Reference".

RTE Transformations

Transformations are directives for parsing HTML markup. They are executed by the TYPO3 Core every time a RTE-based field is saved to the TYPO3 database or fetched from the database for the Rich Text Editor to render. This way, there are always two ways / two transformations applied.

There are several advantages for transformations, the most prominent reason is to not inject bad HTML code into the database which in turn would be used for output. Transformations from the RTE towards the database can filter out HTML tags or attributes.

You can read more about RTE Transformations in TYPO3 Explained.

A Brief Dive Into History

Back in the very old days of TYPO3, there was an RTE which only worked inside Microsoft Internet Explorer 4 (within the system extension “rte”). All other editors of TYPO3 had to write HTML by hand, which was very complicated with all the table-based layouts available. Links were not set with a <a> tag, but with a so-called <typolink 23,13 _blank> tag. Further tags were <typolist> and <typohead>, which were stored in the database 1:1. Since RTEs did not understand these special tags, they had to transform these special tags into valid HTML tags. Additionally, TYPO3 did not store regular <p> or <div> tags but treated every line without a surrounding HTML block element as <p> tag. The frontend rendering then added <p> tags for each line when parsing (see below).

Transformations were later used to allow <em>/ <strong> tags instead of <b>/ <i> tags, while staying backwards-compatible.

A lot of transformation options have been dropped for TYPO3 v8, and the default configuration for these transformations acts as a solid base. CKEditor itself includes features that work as another security layer for disallowing injecting of certain HTML tags in the database.

For TYPO3 v8, the <typolink> tag was migrated to proper <a> tags with a special <a href="t3://page?id=23"> syntax when linking to pages to ensure HTML valid output. Additionally, all records that are edited and stored to the database now contain proper <p> tags, and transformations for paragraph tags are only applied when not set yet.

Transformations for invalid links and images (still available in HtmlArea) are still in place.

Most logic related to transformations can be found within \TYPO3\CMS\Core\Html\RteHtmlParser .

Transformations vs. CKEditor’s Advanced Content Filter

TYPO3’s HtmlParser transformations were used to transform readable semi-HTML code to a full-blown HTML rendering ready for the RTE and vice versa. Since TYPO3 v8, magically adding <p> tags or transforming <typolink> tags is not necessary anymore, which leaves transformations almost obsolete.

However, they can act as an extra fallback layer of security to filter out disallowed tags when saving. TYPO3 v8 configuration ships with a generic transformation configuration, which is mainly based on legacy functionality shipped with TYPO3 nowadays.

However, CKEditor comes with a separate strategy of allowing which HTML tags and attributes are allowed, and can be configured on an editor-level. This configuration option is called “allowedContent”, the feature itself is named Advanced Content Filter (ACF).

Activating CKEditor’s table plugin allows to add <table>, <tr> tags etc. Enabling the link picker enables the usage of <a> tags. CKEditor cleans content right away which was e.g. copy-pasted from MS Word and does not match the allowed tags.

Frontend Output Configuration

Mostly due to historical reasons, the frontend output added <p> tags to each line which is not wrapped in HTML. Additionally the <typolink> tag was replaced by <a> tags and checked if e.g. if a link was set to a specific page within TYPO3 is actually accessible for this specific visitor.

The latter part is still necessary, so the <a href="t3://page?id23"> HTML snippet is replaced by a speaking URL which the power of typolink will still take care of. There are, of course, more options to it, like default “target” attributes for external links or spam-protecting links to email addresses, which all happens within the typolink logic, the master for generating a link in the TYPO3 Frontend rendering process.

TypoScript

As with every content that is rendered via TYPO3, this processing for the frontend output of Rich-Text-Editing fields is done via TypoScript, more specifically within the stdWrap property parseFunc. With Fluid Styled Content and CSS Styled Content comes lib.parseFunc and lib.parseFunc_RTE which add support for parsing <a> and <link> tags and dumping them into the typolink functionality. The shipped TypoScript code looks like this:

lib.parseFunc.tags {
  a = TEXT
  a {
    current = 1
    typolink {
      parameter.data = parameters:href
      title.data = parameters:title
      ATagParams.data = parameters:allParams
      target.data = parameters:target
      extTarget = {$styles.content.links.extTarget}
      extTarget.override.data = parameters:target
    }
  }
}
Copied!

If you already use Fluid Styled Content and CSS Styled Content and you haven’t touched that area of TypoScript yet, you’re good to go by including the TypoScript file.

Fluid

Outputting the contents of a RTE-enabled database field within Fluid can be achieved by adding {record.myfield -> f:format.html()} which in turn calls stdWrap.parseFunc with lib.parseFunc_RTE thus applying the same logic. Just ensure that the lib.parseFunc_RTE functionality is available.

You can check if this TypoScript snippet is loaded by using Web > TypoScript and use the TypoScript Tree (Setup) to see if lib.parseFunc_RTE is filled.

Configuration Best Practices

Use a Sitepackage extension

It is generally recommended to use a sitepackage extension to customize a TYPO3 website. The sitepackage contains configuration files for that site.

See the TYPO3 Sitepackage Tutorial on how to create a sitepackage. We assume here your sitepackage extension has the key my_sitepackage.

The YAML preset files should be kept in folder EXT:my_sitepackage/Configuration/RTE/.

RTE configurations need to be registered in your sitepackages ext_localconf.php:

EXT:my_sitepackage/ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['myconfig']
    = 'EXT:my_sitepackage/Configuration/RTE/MyConfiguration.yaml';
Copied!

Use TYPO3’s Core Default.yaml as boilerplate

It is recommended to start by copying the file typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml into your sitepackage to the file EXT:my_sitepackage/Configuration/RTE/MyConfiguration.yaml.

Check TYPO3's Core Full.yaml to gain insight into a more extensive configuration

This preset shows more configured options and plugins. It is not intended for real use. It acts as an example.

typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml

Use Core includes

It is recommended to use the following includes at the top of your custom configuration:

EXT:my_sitepackage/Configuration/RTE/MyConfiguration.yaml
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
Copied!

If you started out by copying this extensions Default.yaml as boilerplate the imports should already be there.

The include files are already split up so the processing transformations can just be included or even completely disabled (by removing the line for importing).

Please be aware that removing the Processing.yaml removes security measures. In that case you have to take care of keeping the ckeditor safe yourself.

Configuration Examples

How do I use a different preset?

Instead of using the default "default" preset, you can change this, for example to "full", using page TSconfig:

EXT:my_sitepackage/Configuration/page.tsconfig
RTE.default.preset = full
Copied!

Of course, the preset must already exist, or you must define it. rte_ckeditor ships with presets "minimal", "default" and "full".

Additionally, you can set specific presets for specific types of textfields.

For example to use preset "full" for the field "bodytext" of all content elements:

EXT:my_sitepackage/Configuration/page.tsconfig
RTE.config.tt_content.bodytext.preset = full
Copied!

To use preset "minimal" for the field "bodytext" of only content elements with ctype="text":

EXT:my_sitepackage/Configuration/page.tsconfig
RTE.config.tt_content.bodytext.types.text.preset = minimal
Copied!

For more examples, see RTE in "TSconfig Reference".

How do I create my own preset?

In your sitepackage extension:

In ext_localconf.php, replace my_extension with your extension key, replace my_preset and MyPreset.yaml with the name of your preset.

EXT:my_sitepackage/ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['my_preset']
    = 'EXT:my_extension/Configuration/RTE/MyPreset.yaml';
Copied!

In Configuration/RTE/MyPreset.yaml, create your configuration, for example:

EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml
# Import basic configuration
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
# Add configuration for the editor
# For complete documentation see http://docs.ckeditor.com/#!/api/CKEDITOR.config
editor:
  config:
    # Include custom CSS
    contentsCss:
      - "EXT:my_extension/Resources/Public/Css/rte.css"
Copied!

See also the note for editor.config.contentsCss.

How do I customize the toolbar?

The toolbar can be customized individually by configuring required toolbar items in the YAML configuration. The following configuration shows the toolbar configuration of the minimal editor setup included in file EXT:rte_ckeditor/Configuration/RTE/Minimal.yaml:

EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml
# Minimal configuration for the editor
editor:
  config:
    toolbar:
      items:
        - bold
        - italic
        - '|'
        - clipboard
        - undo
        - redo
Copied!

The '|' can be used as a separator between groups of toolbar items.

Additional configuration options are available in the official CKEditor 5 Toolbar documentation

Grouping toolbar items in drop-downs

To save space in the toolbar or to arrange the features thematically, it is possible to group several items into a dropdown as shown in the following example:

EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml
# Minimal configuration for the editor
editor:
  config:
    toolbar:
      items:
        - bold
        - italic
        - { label: 'Additional', icon: 'threeVerticalDots', items: [ 'specialCharacters', 'horizontalLine' ] }
Copied!

How do I allow a specific tag?

Allowed content in CKEditor5 is to be configured via the General HTML Support plugin option config.htmlSupport.

EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml
# Allow the <iframe> tag with all attributes, all classes and all styles,
# as well as demonstrating class restrictions to the <i> tag
editor:
  config:
    htmlSupport:
      allow:
        - { name: 'iframe', attributes: true, classes: true, styles: true }
        # multiple definitions for the same tag name are possible
        - { name: 'i', classes: [ 'fa-brands', 'fa-typo3' ] }
        # allows any repetitive class name, that starts with `fa-`
        # (the regular expression has to be defined in `pattern`)
        - { name: 'i', classes: { pattern: '^((fa-[^\h]+)(\h+|$))+' } }
Copied!

How do I configure the font plugin?

New in version 12.4.12

In order to use the font plugin, the RTE configuration needs to be adapted:

EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml
editor:
  config:
    toolbar:
      items:
        # add button to select font family
        - fontFamily
        # add button to select font size
        - fontSize
        # add button to select font color
        - fontColor
        # add button to select font background color
        - fontBackgroundColor

    fontColor:
      colors:
        - { label: 'Orange', color: '#ff8700' }
        - { label: 'Blue', color: '#0080c9' }
        - { label: 'Green', color: '#209d44' }

    fontBackgroundColor:
      colors:
        - { label: 'Stage orange light', color: '#fab85c' }

    fontFamily:
      options:
        - 'default'
        - 'Arial, sans-serif'

    fontSize:
      options:
        - 'default'
        - 18
        - 21

    importModules:
      - { 'module': '@ckeditor/ckeditor5-font', 'exports': [ 'Font' ] }
Copied!

More information can be found in the official documentation of CKEditor.

How do I create a custom plugin?

With CKEditor 5 the plugin architecture has changed and CKEditor 4 plugins are not compatible with CKEditor 5. It is advised to read the CKEditor 4 to 5 migration to understand the conceptual changes, also related to plugins.

Writing a custom plugin for CKEditor 5 can be done in TypeScript or JavaScript, using the CKEditor5 plugin system.

In this example, we integrate a simple timestamp plugin to CKEditor 5. Make sure to replace <my_extension> with your extension key.

  1. Create the plugin file

    Add the following ES6 JavaScript code:

    EXT:<my_extension>/Resources/Public/JavaScript/Ckeditor/timestamp-plugin.js
    import { Plugin } from '@ckeditor/ckeditor5-core';
    import { ButtonView } from '@ckeditor/ckeditor5-ui';
    
    export class Timestamp extends Plugin {
      static pluginName = 'Timestamp';
    
      init() {
        const editor = this.editor;
    
        // The button must be registered among the UI components of the editor
        // to be displayed in the toolbar.
        editor.ui.componentFactory.add(Timestamp.pluginName, () => {
          // The button will be an instance of ButtonView.
          const button = new ButtonView();
    
          button.set({
            label: 'Timestamp',
            withText: true
          });
    
          // Execute a callback function when the button is clicked
          button.on('execute', () => {
            const now = new Date();
    
            // Change the model using the model writer
            editor.model.change(writer => {
    
              // Insert the text at the user's current position
              editor.model.insertContent(writer.createText(now.toString()));
            });
          });
    
          return button;
        });
      }
    }
    Copied!
  2. Register the ES6 JavaScript

    EXT:<my_extension>/Configuration/JavaScriptModules.php
    <?php
    
    return [
        'dependencies' => ['backend'],
        'tags' => [
            'backend.form',
        ],
        'imports' => [
            '@my-vendor/my-package/timestamp-plugin.js' => 'EXT:my_extension/Resources/Public/JavaScript/Ckeditor/timestamp-plugin.js',
        ],
    ];
    
    Copied!
  3. Include the plugin in the CKEditor configuration

    EXT:<my_extension>/Configuration/RTE/MyPreset.yaml
    editor:
      config:
        importModules:
          - { module: '@my-vendor/my-package/timestamp-plugin.js', exports: [ 'Timestamp' ] }
        toolbar:
          items:
            - bold
            - italic
            - '|'
            - clipboard
            - undo
            - redo
            - '|'
            - timestamp
    
    Copied!
    The importModules item in line 4 imports the previously registered ES6
    module. The timestamp item in line 14 adds the plugin to the toolbar.
  4. Use the plugin

    The custom timestamp plugin in the editor

    The custom timestamp plugin in the editor

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:

MyCKPreset.yaml
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:

MyCKPreset.yaml
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:

MyCKPreset.yaml
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">):

MyCKPreset.yaml
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:

MyCKPreset.yaml
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:

MyCKPreset.yaml
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.

Basic Usage

How the editor toolbar looks and what is available will depend on the currently used configuration.

The CKEditor will be active for RTE fields, for example the Text field of a content element.

For information about working with content elements, see the section Editing content and The rich text editor in the "Tutorial for Editors".

The following examples are done using the preset which is installed with the Introduction Package.

Example: Use bold

Select text and click on the B (for bold) button:

Sitemap