Issue Bug Closed

#104377RTE Classes got overwritten after every save & open RTE again

Mohamed Masmoudi 07/12/24, 10:51 updated 07/12/24, 22:20

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Garvin Hicking commented and changed status New Needs Feedback 07/12/24, 19:45

    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

  2. Mohamed Masmoudi commented and changed done 0 % 100 % 07/12/24, 20:59

    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.

  3. Garvin Hicking commented and changed status Needs Feedback Closed 07/12/24, 22:20

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