Project

General

Profile

Actions

Bug #104377

closed

RTE Classes got overwritten after every save & open RTE again

Added by Mohamed Masmoudi 15 days ago. Updated 15 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2024-07-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
typo3
Complexity:
Is Regression:
Sprint Focus:

Description

I have a TYPO3 v12 Installation, i have added some custom style definitions to the RTE:

    style:
      definitions:
        - { name: "Headline P", element: "p", classes: [ 'headline' ] }
        - { name: "Headline H1", element: "h1", classes: [ 'headline' ] }
        - { name: "Headline H2", element: "h2", classes: [ 'headline' ] }
        - { name: "Headline H3", element: "h3", classes: [ 'headline' ] }
        - { name: "Subheadline P", element: "p", classes: [ 'headline headline--sub' ] }
        - { name: "Subheadline H1", element: "h1", classes: [ 'headline headline--sub' ] }
        - { name: "Subheadline H2", element: "h2", classes: [ 'headline headline--sub' ] }
        - { name: "Subheadline H3", element: "h3", classes: [ 'headline headline--sub' ] }

After i modify the Text content element, for example if i have some text with a class 'headline headline--sub' after save and open again in RTE, this class is getting back to 'headline' class again. This Mean that every time i open the Text content element i have to redo every style [ 'headline headline--sub' ] before i save it again.

Actions #1

Updated by Garvin Hicking 15 days ago ยท Edited

  • Status changed from New to Needs Feedback

Have you tried if

classes: [ 'headline', 'headline--sub' ]

works? I believe only single classes are allowed as array values, but the ckeditor docs seem vague about this

Actions #2

Updated by Mohamed Masmoudi 15 days ago

  • % Done changed from 0 to 100

Garvin Hicking wrote in #note-1:

Have you tried if

classes: [ 'headline', 'headline--sub' ]

works? I believe only single classes are allowed as array values, but the ckeditor docs seem vague about this

Thank you Garvin, this is exactly was the solution.

Actions #3

Updated by Garvin Hicking 15 days ago

  • Status changed from Needs Feedback to Closed

Yay, that's great :) Closing the issue then.

Actions

Also available in: Atom PDF