Here is an example on how to create an emoticon dropdown, which will insert an emoticon in the editor's content:
- Download the zip file (from the EXAMPLE FILES section below) that contains 9 emoticons. You can replace all of them at a later time, if needed.
- Unzip the icons in a folder named Emoticons in the root of your web application.
- Add the custom dropdown to the editor toolbar via the ToolsFile.xml file:
| ASP.NET |
Copy Code |
|
<tool iconurl="~/Emoticons/smil1.GIF" name="Emoticons" type="dropdown" dropdownwidth="95px" ItemsPerRow="3"> <item iconurl="./Emoticons/smil1.GIF" value="./Emoticons/smil1.GIF" /> <item iconurl="./Emoticons/smil2.GIF" value="./Emoticons/smil2.GIF" /> <item iconurl="./Emoticons/smil3.GIF" value="./Emoticons/smil3.GIF" /> <item iconurl="./Emoticons/smil4.GIF" value="./Emoticons/smil4.GIF" /> <item iconurl="./Emoticons/smil8.GIF" value="./Emoticons/smil8.GIF" /> <item iconurl="./Emoticons/smil6.GIF" value="./Emoticons/smil6.GIF" /> <item iconurl="./Emoticons/smil7.GIF" value="./Emoticons/smil7.GIF" /> <item iconurl="./Emoticons/smil9.GIF" value="./Emoticons/smil9.GIF" /> <item iconurl="./Emoticons/smil11.GIF" value="./Emoticons/smil11.GIF" /> </tool> |
 |
Note that the iconurl and the value attirubute should point correctly to the respective image icon placed in the Emoticons folder. |
-
In your editor page, add the following javascript command that will be executed when the user presses some of the dropdown icons, i.e.
| ASP.NET |
Copy Code |
|
<rad:RadEditor id="RadEditor1" Editable="true" Runat="server"></rad:RadEditor> <script type="text/javascript"> RadEditorCommandList["Emoticons"] = function(commandName, editor, oTool) { oValue = oTool.GetSelectedValue(); editor.PasteHtml ("<img src='" + oValue + "' border=0>"); }; </script> |
- Once you have accomplished all of the above steps, your editor toolbar should look similar to this:

EXAMPLE FILES
Emoticons