Apply CSS classes in Rich Text Editor in Sitecore

You can add your customized CSS class in the list of Apply CSS Classes drop down of Rich Text Editor like following:

Here are some steps following which you can achieve this:

1. In the web.config file check the value of setting WebStylesheet. By default, it is “/default.css“. Open that file (default.css file located at the root folder of the website) and add your css classes here like following:

2. Open the ToolsFile.xml file located at rootfolder\sitecore\shell\Controls\Rich Text Editor\ folder and add css class entries in <classes> node like following

Here name property is a text which will be displayed in a dropdown of Apply Css Classes in RichText Editor and the value property must be same as your class name defined in the default.css file.

3. Go to rich text editor field of your template and make sure the source property of it is set to either Rich Text Full or Rich Text Medium

It’s done. Check your item’s rich text editor field and you can see the list of css classes in the dropdown. If the classes are not there, clear your Sitecore Cache (/sitecore/admin/cache.aspx) and browser cache. If it still not appear, restart your IIS-website.

Cheers!

Re-posted from https://learnsitecorebasics.wordpress.com/2015/03/17/apply-css-classes-in-rich-text-editor/

Leave a Reply

Your email address will not be published. Required fields are marked *