Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Using the Style plugin in the Rich Text Editor to apply classes to block level elements.

Avatar

Level 1

Hi
I am very new to Adobe Experience Manager and we're playing with the Style plugin within the Rich Text Editor in AEM.

We have successfully implemented the Style dropdown in the RTE. 
However I'd like to be able to pick a block level element and select a style from the drop down and apply it to the block level element ie img, p, h3.
It's working kind but the class="this-style" is determined to be applied to a span rather than img class="this-style".

 

I read in the Config documentation, "Stylized content is enclosed in span tags using the class attribute to refer to the CSS class. For example, <span class=monospaced>Monospaced Text Here</span>." 
ref https://experienceleague.adobe.com/en/docs/experience-manager-65/content/sites/administering/operati...

Question for the gurus out there.
Who amongst you has successfully used the Styles plugin within the RTE to apply styles to a block level element, ie a paragraph or an image, rather than a span.
How did you do it?  What tricks, tips, insight do you have?

Thank you for your time, consideration and experience!
Regards
Croydon

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Croydon 
You may need a custom plugin to achieve this. For example I have created a plugin to apply class to any element within RTE

https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Croydon 
You may need a custom plugin to achieve this. For example I have created a plugin to apply class to any element within RTE

https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html 



Arun Patidar