Can you change the tag a class is applied to in the style system?

Avatar

Avatar

pmueller88

Avatar

pmueller88

pmueller88

05-03-2020

When you add styles to the "allowed styles" using the style system  on a components policy, it seems that the class is added to the parent container that is generated by the component instead of the main tag that contains the content. Specifically I'm referring to the text component. You can have many different tag options, (i.e. H1 - H6, p, small) to contain the text. But when you add the allowed styles, the class is added to the parent div. I need the classes to be added directly to the tag holding the text. Is this a possible change?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

06-03-2020

Style system adds class at component wrapper div. To add class to any HTML element(ul,li,p,h1...) you have to create a RTE plugin which can add styles directly to the specific element.

 

Please check similar plugin at https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html

Answers (0)