Sitecore is an incredibly good platform that provides a lot of functionality out of the box, but one of the great things about Sitecore is that if there is something custom that you’d like to add in, there’s always a way to do it.
In this post I’m going to describe the main purpose of RichTextEditor and inroduce you th the ways of its extension.
What is the Rich Text Editor in Sitecore
The Rich Text Editor is the main tool for authors in Sitecore for entering and editing the content of a website. It is the tool through which text is maintained in Rich Text fields in Sitecore templates. It can be used in both the Content Editor and the Page Editor in a popup window, but is not to be confused with the webedit field in the page editor.
Below you see the Rich Text Editor (RTE) with all standard functions in the ‘Full’ configuration enabled:
All wonderful tools for a group of well-trained and tamed content editors, who knows HTML and CSS to the bone and can’t make mistakes, ever… Well, unfortunately this does not describe the standard content editor, which more often than not, does not have HTML and CSS as main education areas. So you should very carefully think about what kind of tools you actually want to offer your content editors.
How to configure the Rich Text Editor
Configuring the RTE in Sitecore is not hard and it involves 2 steps. Setup a ‘HTML Editor Profile’ and configuring the website to use this profile.
Setup a HTML Editor Profile
Login to Sitecore and navigate to ‘/sitecore/system/Settings/Html Editor Profiles’ (be sure that you have switched to core database; database selector can help you). Here you see the different profiles that Sitecore comes with. To setup a profile, remember to copy one of the existing profiles and edit in the copy, rather than editing and possibly destroying one of the original profiles.
If you are beginner in Sitecore and don’t know how to copy something inside it just repeat the following:
- select desire item in Sitecore
- open ContextMenu for it (mouse right-click does it)
- select Copying -> Copy To
When you open for example the ‘Rich Text Full’ profile, you see a list of folders that contains items that can be buttons or contain items that support som of the buttons in the editor. These are the items that you want to delete or change to limit the functionality in the editor.
Try copying the “Rich Text Full” to “Rich Text XYZ” and try deleting the ‘Toolbar 3’ folder.
Configure the website to use the custom HTML Editor Profile
Open your web.config and locate the setting ‘HtmlEditor.DefaultProfile’. Change the value to the name of your custom profile.
Now when editing a Rich Text field, you’ll see the editor using your new profile.
You can get quite far as to setting up the editor this way. The next couple of posts will look at restricting functions based on access righst and creating custom buttons.