Define custom format_tags in CKEditor (in TYPO3)

To add a new value to the “Paragraph Format” Dropdown, you need to edit the config.yaml which is used to configure the CKEditor. It is actually easy, but not quite well-documented yet.

To add another h2 with a certain CSS class, you just add the following in the default.yaml:

editor:
  config:
    format_tags: "p;h1;h2;h3;h2special"
    format_h2special: { name: "H2 Special", element: 'h2', attributes: { 'class': 'special' } }

It is important, that the name of line 2 is called format_NAME or else it won’t work.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.