can we append inline styles in RTE instead of classes | Community
Skip to main content
Level 3
Jun 17, 2022 7:27 PM UTC
Solved

can we append inline styles in RTE instead of classes

Hi,

 

Can we append inline styles directly instead of custom classes in RTE

 

Example : when custom style is selected in RTE it is appending as

<span class="text-blue"><span> instead of that can we append inline styles 

 

like <span style="font-size: 23px;
color: #FFF;"></span>

 

Please provide suggestions!

 

Thank you!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
MayurSatav
MayurSatavAccepted solution
New Participant
Jun 20, 2022 6:00 AM UTC

Hi @satish2info-1 ,

 

Yes, you can do that using the RTE source edit plugin. But if it is removing your style attributes after submitting dialog then you need to enable those attributes from xssprotection.xml file. Check out this blog for more details.

 

 

8 replies

MayurSatav
MayurSatavAccepted solution
New Participant
Jun 20, 2022 6:00 AM UTC

Hi @satish2info-1 ,

 

Yes, you can do that using the RTE source edit plugin. But if it is removing your style attributes after submitting dialog then you need to enable those attributes from xssprotection.xml file. Check out this blog for more details.

 

 

Translate
kautuk_sahni
Employee
Jun 20, 2022 6:43 AM UTC

@mayursatav , great blog, thank you for creating it 🙂 

Translate
Kautuk Sahni
MayurSatav
New Participant
Jun 20, 2022 6:51 AM UTC

Thanks @kautuk_sahni  

Translate
arunpatidar
New Participant
Jun 19, 2022 12:52 PM UTC

Hi,

For the email templates, you can use internal css styling and still live with class name instead of inline styling.

 

Translate
Arun Patidar
SantoshSai
New Participant
Jun 17, 2022 7:48 PM UTC

Hi @satish2info-1 ,

If you have enabled source code plugin, IMHO It's absolutely OK to have inline styles with RTE. I have used many times in my past specially in Email Campaign.

However, It is best practice to add styles through dialog 

Reference: https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/configure-rich-text-editor-plug-ins.html?lang=en#text-styles

Hope that helps!

Regards,

Santosh

Translate
Santosh Sai
Level 3
Jun 19, 2022 12:03 PM UTC

Hi @santoshsai 

Thank you for your reply,

 

Yes, we can able to achieve with RTE but my question is when we using the RTE when we select the particular style it will append corresponding style class instead of that i have to append direct style in RTE. Can we able to do this?

 

like :

 

RTE works like : <span class="text-blue"><span> instead of that can we append inline styles 

 

but i have to append directly  inline styles <span style="font-size: 23px; color: #FFF;"></span>

 

Regards,

Satish.

Translate