Sitecore: Adding your own buttons to the RichText editor

It’s surprisingly easy to add your own functionality to the Sitecore Rich Text editor. First you need to register your button in Sitecore:

/system/settings/Html Editor Profiles/Rich Text Default/Toolbar 1

Duplicate an existing button and you will have added a new button to the first toolbar in the default Rich Text Editor.
Change the “Click” field of your new button to a unique text. I have changed mine to “MyNewButton”.

Then you must change the Rich Text javascript file. You’ll find the file at:

/sitecore/shell/Controls/Rich Text Editor/RichText Commands.js

This file contains the commands for the Rich Text editor. Here you can add your own “RadEditorCommandList” for the “MyNewButton”: 

RadEditorCommandList["MyNewButton"] = function(commandName, editor, tool)

Inside this function you can add code to add text to the editor:

var str = "This is my new text. This will be inserted at the cursor position";

Here is another example where I call a webservice and inserts the response:

var xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP”);“POST”,”/service.asmx/MyFunction”,false);
xmlhttp.send(“param=” + escape(“my parameter”));
if (xmlhttp.status==200)
  var str = xmlhttp.responseText;
  str = str.replace(/

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore 5, Sitecore 6 and tagged , , , , , . Bookmark the permalink.

2 Responses to Sitecore: Adding your own buttons to the RichText editor

  1. Pingback: Adding functionality to the Sitecore Rich Text Editor – Part 1 « horizontalintegration

  2. vamshik says:

    Thanks for providing this Information. In Sitecore when I create an Image Map and save it in Rich Text Editor, it gives me a XHTML Validation error. Do you have any ideas to overcome this?
    Also Sitecore Image Map editor by default doesn’t allow you to use Internal Sitecore Links..You have to type the whole url. Can you suggest me any solution for this as well..

    Thanks for your time……


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.