RadEditor for ASP.NET AJAX

RadControls Send comments on this topic.
Using the ToolsFile.xml
See Also
Controls > RadEditor > Using the ToolsFile.xml

Glossary Item Box

 

RadEditor for ASP.NET AJAX can populate its toolbar tools and modules through a ToolsFile.xml.

The ToolsFile must have a valid XML structure as shown below:

  • All attributes and their values are case sensitive and all tags should be closed properly.
  • If you want to add special symbols in the ToolsFile it should be in Unicode format. If encoding is not set, RadEditor will raise a System.Xml.XmlException.

You can also create your own ToolsFile.xml using the provided information below:
ToolFile.xml Copy Code
<root>
    
<modules>
            
<module />
            
<module />
    
</modules>
    
<tools>
            
<tool />
            
<tool />
            
...
   
</tools>
   
<tools>
            
<tool />
            
...
   
</tools>
    
...
   
<links>
           
<link />
           
<link />
   
</links>
   
<colors>
           
<color />
           
<color />
   
</colors>
</
root>

Tools And Modules Attributes:

<tool> element valid attributes:

name(required):

AboutDialog

FindAndReplace

Indent

InsertTime

Outdent

StrikeThrough

Zoom

AbsolutePosition

FlashManager

InsertHorizontalRule

InsertUnorderedList

Paste

Subscript

 XhtmlValidator

ApplyClass

FontName

InsertCustomLink

Italic

PasteAsHtml

Superscript

 TrackChangesDialog

BackColor

FontSize

InsertDate

JustifyCenter

PasteFromWord

TemplateManager

 FormatCodeBlock

Bold

ForeColor

InsertFormElement

JustifyFull

PasteFromWordNoFontsNoSizes

ToggleDocking

 

Copy

FormatBlock

InsertOrderedList

JustifyLeft

PastePlainText

ToggleScreenMode

 

Custom

FormatStripper

InsertParagraph

JustifyRight

Print

ToggleTableBorder

 

Cut

Help

InsertSnippet

LinkManager

Redo

Underline

 

DecreaseSize

ImageManager

InsertSymbol

MediaManager

RepeatLastCommand

Undo

 

DocumentManager

IncreaseSize

InsertTable

ModuleManager

AjaxSpellCheck

Unlink

shortcut
(not required):

The key combination for the specific tool:

Copy Code
<tool name="LinkManager" shortcut="Ctrl+L" />
<tool name="TemplateManager" shortcut="Ctrl+Shift+Alt+T" />
showtext
(not required)
Specifies whether to display the button name next to its icon

<tool name="ImageManager" shortcut="Ctrl+G" showtext="true" />
showicon
(not required)
Specifies whether to display the tools icon or not. Default value is true.

Copy Code
<tool name="ImageManager" shortcut="Ctrl+G" showicon="false" showtext="true" />

 

<separator> element

true/false Indicates whether a separator should appear at current position.

 

<tools> element valid attributes:

name (required): This string will identify the toolbar.

 

<module> element valid attributes:
(module elements should appear as child elements of an element "modules")

name (required):

The friendly name of the module. When in floating mode the name will appear in the tool's titlebar.

visible (not required):

(Indicates whether the module should appear in the toolbar or not. This module will be available client-side - the property defines only the visibility of the module. )

 

<link> element valid attributes:
(link elements should appear as child elements of an element "links")

name (required):

Link/Category Name/Alias

href (not required):

URL of the link/category

target (not required):

The target window of the link

tooltip (not required):

The tooltip for the link


<symbol> element valid attributes:
(symbol elements should appear as child elements of an element "symbols")

value (required):

The symbol to be displayed


<font> element valid attributes:
(font elements should appear as child elements of a tool element with "name" attribute set to "fontNames")

name (required):

Font Name

 

<class> element valid attributes:
(class elements should appear as child elements of an element "classes")

name (required):

Class Alias

value (required):

Class Name

 

<paragraph> element valid attributes:
(paragraph elements should appear as child elements of an element "paragraphs")

name (required):

Paragraph Alias

value (required):

Paragraph Name

 

<color> element valid attributes:
(color elements should appear as child elements of an element "colors")

value (not required):

Hex value of the color

<snippet> element valid attributes:
(snippet elements should appear as child elements of an element "snippets")

name (required):

Snippet Alias

 

<language> element valid attributes:
(language elements should appear as child elements of an element "Languages")

code (required):

Language code

title (required):

Language Title

 

The contextMenus tag in the Tools file allows you to change the default or specify custom context menus for different HTML elements.

 

<contextMenu> element valid attributes:
(contextMenu elements should appear as child elements of an element "contextMenus")

forElement (required):

The HTML element that will call this menu.

enabled (required):

Defines if this context menu is switched.



The example below shows how to attach custom context menus for <A> and <P> elements.

ToolFile.xml Copy Code
<contextMenus>
  
<contextMenu forElement="A" enabled="false">
  
</contextMenu>
  
<contextMenu forElement="P">
      
<tool name="JustifyLeft" />
      
<tool name="JustifyCenter" />
      
<tool name="JustifyRight" />
      
<tool name="JustifyFull" />
  
</contextMenu>
</
contextMenus>

 

By editing the editor's ToolsFile.xml file you easily customize the editor's toolbar and add or remove toolbar buttons. In case you have multiple editor's on the same page, you can provide them with different set of tools by setting ToolsFile property to point to different ToolsFile.xml files:

ASPX/ASCX Copy Code
<telerik:RadEditor ToolsFile="~/ToolsFile1.xml" ID="RadEditor1" runat="server"></telerik:RadEditor>
<
telerik:RadEditor ToolsFile="~/ToolsFile2.xml" ID="RadEditor2" runat="server"></telerik:RadEditor>
<
telerik:RadEditor ToolsFile="~/ToolsFile3.xml" ID="RadEditor3" runat="server"></telerik:RadEditor>


 

See Also

Examples in QSF
Default Configuration