Bug #89360
Updated by Jens Hoppe about 5 years ago
Using this configuration <pre><code class="yaml"> editor: config: contentsCss: "EXT:my_sitepackage/Resources/Public/Css/rte.css" stylesSet: # headers - { name: "LLL:EXT:my_sitepackage/Resources/Private/Language/Backend.xlf:header.trenner.name", "LLL:EXT:lcms_sitepackage/Resources/Private/Language/Backend.xlf:header.trenner.name", element: ["h1" , "h2" , "h3" , "h4", "h5"] , attributes: { 'class': 'trenner' } } </code></pre> an option _Trenner_ appears in the list of available Styles once an editor choses one of the headings h1, h2, h3, h4 or h5. The class _trenner_ is defined in _contentsCss_: <pre><code class="css"> h1.trenner, h2.trenner, h3.trenner, h4.trenner, h5.trenner { font-size: 1.66em; ... border-top: 1px solid #777777; } </code></pre> The style can successfully be applied to a heading in the editor (Screenshot _rte_ckeditor_style-applied.png_). Once you click save the style will be saved in _tt_content.bodytext_ (or for whichever field the above preset is defined), so in the frontend everything looks fine. When the content element is opened/edited again at a later point in time (and the content of the editor is loaded from the database) the class _trenner_ is not applied to the heading anymore (Screenshot _rte_ckeditor_style-not-applied-after-reopening.png_). This means that whenever you edit this element the class has to be reapplied manually which is a real nuisance. From what I gather this is not caused by a malconfigured _HTMLparser_db_ as I haven't defined any. Additionally all works fine if I define only one element (i.e. only _h1_) instead of five, like such: <pre><code class="yaml"> editor: config: contentsCss: "EXT:my_sitepackage/Resources/Public/Css/rte.css" stylesSet: # headers - { name: "LLL:EXT:my_sitepackage/Resources/Private/Language/Backend.xlf:header.trenner.name", "LLL:EXT:lcms_sitepackage/Resources/Private/Language/Backend.xlf:header.trenner.name", element: ["h1"] , attributes: { 'class': 'trenner' } } </code></pre> The above configuration with a Style Set for multiple tags worked flawlessly in TYPO3 8.7.10 with ckeditor 4.7.1 (for some reasons I still had a few of these older installations running up until recently) but it doesn't work in TYPO3 8.7.27 with ckeditor 4.11.3 anymore.