
I am trying to set our custom toolbar for the RadEditor, which worked in previous versions.
I tried to specify a virtual path in the ToolsFile like so:
protected
void
Page_Load(
object
sender, EventArgs e)
{
reditDescription.ToolsFile =
"~/WebsiteTemplates/ControlTemplates/EditorToolsFile.xml"
;
And I got this little error:
Could not find a part of the path 'C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\~\WebsiteTemplates\ControlTemplates\EditorToolsFile.xml'.
It appends a physical path for some strange reason.
So I thought maybe I'd try a physical path since it wants to append a physical path:
protected
void
Page_Load(
object
sender, EventArgs e)
{
reditDescription.ToolsFile = Server.MapPath(
"~/WebsiteTemplates/ControlTemplates/EditorToolsFile.xml"
);
When I do this I get this error:
'C:/Program Files/Telerik/Sitefinity 4.4/Projects/HealthChoiceWebsite/WebsiteTemplates/ControlTemplates/EditorToolsFile.xml' is a physical path, but a virtual path was expected.
These errors are both contradictory to each other. Making this feature completely useless. Which one do I use? Physical path, or virtual?
What is the solution to this?
13 Answers, 1 is accepted

Why is this not working?

Would it possible to try editting the ToolsFile directly from Sitefinity by going to Administration -> Settings -> TextEditor Default tool set - > Edit. From there you can again edit the set of tools available. Or you could upload the fire directly using the button. Also, could you try setting the file from the settings by going to the Sitefinity backend >> Administration >> Settings >> Advanced >> Appearance: Screenshot
I hope these approaches will help you get around the error you are currently getting, if this is not the case I will be glad to assist further.
Atanas Valchev
the Telerik team

Could you, please, upload your custom tools file so I can test it on my local Sitefinity projects?
Atanas Valchev
the Telerik team

<
root
>
<
tools
dockable
=
"false"
>
<
tool
name
=
"Bold"
shortcut
=
"CTRL+B"
/>
<
tool
name
=
"Italic"
shortcut
=
"CTRL+I"
/>
<
tool
name
=
"JustifyLeft"
/>
<
tool
name
=
"JustifyCenter"
/>
<
tool
name
=
"JustifyRight"
/>
<
tool
name
=
"JustifyFull"
/>
<
tool
name
=
"InsertOrderedList"
/>
<
tool
name
=
"InsertUnorderedList"
/>
<
tool
separator
=
"true"
/>
</
tools
>
<
tools
name
=
"MainToolbar"
dockable
=
"false"
>
<
tool
name
=
"AjaxSpellCheck"
shortcut
=
"F7"
/>
<
tool
name
=
"PasteFromWordNoFontsNoSizes"
/>
<
tool
name
=
"PastePlainText"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"Undo"
shortcut
=
"CTRL+Z"
/>
<
tool
name
=
"Redo"
shortcut
=
"CTRL+Y"
/>
<
tool
separator
=
"true"
/>
</
tools
>
<
tools
name
=
"InsertToolbar"
dockable
=
"false"
>
<
tool
name
=
"LibraryImageManager"
text
=
"Insert an image"
/>
<
tool
name
=
"LibraryDocumentManager"
text
=
"Insert a document"
/>
<
tool
name
=
"LinkManager"
text
=
"Insert a link"
shortcut
=
"CTRL+K"
/>
<
tool
name
=
"Unlink"
shortcut
=
"CTRL+SHIFT+K"
/>
<
tool
name
=
"FlashManager"
/>
<
tool
name
=
"MediaManager"
/>
</
tools
>
<
tools
name
=
"DropdownToolbar"
dockable
=
"false"
>
<
tool
name
=
"FormatBlock"
/>
<
tool
name
=
"FormatStripper"
/>
<
tool
name
=
"ToggleScreenMode"
/>
</
tools
>
<
links
>
<
link
name
=
"telerik"
href
=
"http://www.telerik.com"
>
<
link
name
=
"Products"
href
=
"http://www.telerik.com/products"
>
<
link
name
=
"r.a.d.controls suite"
href
=
"http://www.telerik.com/radcontrols"
/>
<
link
name
=
"r.a.d.navigation suite"
href
=
"http://www.telerik.com/radnavigation"
/>
<
link
name
=
"r.a.d.editor"
href
=
"http://www.telerik.com/radeditor"
/>
<
link
name
=
"r.a.d.designer"
href
=
"http://www.telerik.com/raddesigner"
/>
<
link
name
=
"r.a.d.spell"
href
=
"http://www.telerik.com/radspell"
/>
<
link
name
=
"r.a.d.chart"
href
=
"http://www.telerik.com/radchart"
/>
<
link
name
=
"r.a.d.menu"
href
=
"http://www.telerik.com/radmenu"
/>
<
link
name
=
"r.a.d.treeview"
href
=
"http://www.telerik.com/radtreeview"
/>
<
link
name
=
"r.a.d.panelbar"
href
=
"http://www.telerik.com/radpanelbar"
/>
<
link
name
=
"r.a.d.rotator"
href
=
"http://www.telerik.com/radrotator"
/>
<
link
name
=
"r.a.d.tabstrip"
href
=
"http://www.telerik.com/radtabstrip"
tooltip
=
"Tooltip"
/>
</
link
>
<
link
name
=
"Purchase"
href
=
"http://www.telerik.com/purchase"
/>
<
link
name
=
"Support"
href
=
"http://www.telerik.com/support"
/>
<
link
name
=
"Client.Net"
href
=
"http://www.telerik.com/clientnet"
/>
</
link
>
<
link
name
=
"Microsoft"
>
<
link
name
=
"Main Site"
href
=
"http://www.microsoft.com"
/>
<
link
name
=
"MSDN Online"
href
=
"http://msdn.microsoft.com"
/>
<
link
name
=
"Windows Update"
href
=
"http://windowsupdate.microsoft.com"
/>
</
link
>
<
link
name
=
"Search Engines"
>
<
link
name
=
"Google"
href
=
"http://www.google.com"
/>
<
link
name
=
"Yahoo"
href
=
"http://www.yahoo.com"
/>
<
link
name
=
"AltaVista"
href
=
"http://www.altavista.com"
/>
</
link
>
</
links
>
<
snippets
>
<
snippet
name
=
"Order Confirmation"
>
<![CDATA[
<div style="width:300px;border:2px outset #D8D2BD;padding:34px;font-family:Arial, Verdana; font-size:11px;background-color:#F1EFE6;">
Dear ____________________,<br />
Thank you for inquiring about ____________. Your request will be processed in 48 hours and shipped at the address you have provided.
<br /><br />
<b>Please, contact us if you have any problems.</b>
</div>
]]>
</
snippet
>
<
snippet
name
=
"Email Signature"
>
<![CDATA[
<div style="margin-top:30px;width:80%;border-top:1px dotted gray;padding-top:4px;font-family:Arial, Verdana; font-size:11px;">
<b>John Wigham</b><br />
Senior Web Developer<br />
<a href="#">john@mysite.com</a>
<br />
<br />
<i>Disclaimer: The contents of this e-mail are privileged and confidential and intended for the addressees at the specified e-mail addresses only.</i>
</div>
]]>
</
snippet
>
<
snippet
name
=
"Problem Report Feedback"
>
<![CDATA[
<div style="width:300px;border:2px outset #D8D2BD;padding:34px;font-family:Arial, Verdana; font-size:11px;background-color:#F1EFE6;">
Hi ____________________,<br />
Thank you for reporting this issue. We have verified the problem and it is logged in our system. We will notify you once we have a solution.
<br /><br />
<b>Please, contact us if you have any problems.</b>
</div>
]]>
</
snippet
>
</
snippets
>
<
symbols
></
symbols
>
<
fontNames
> </
fontNames
>
<
fontSizes
>
</
fontSizes
>
<
realFontSizes
>
<
item
value
=
"11px"
></
item
>
<
item
value
=
"12px"
></
item
>
<
item
value
=
"13px"
></
item
>
<
item
value
=
"14px"
></
item
>
<
item
value
=
"18px"
></
item
>
<
item
value
=
"22px"
></
item
>
</
realFontSizes
>
<
colors
></
colors
>
<
paragraphs
></
paragraphs
>
<
classes
>
<
class
name
=
"Add CssClasses collection here:"
value
=
".attention"
/>
<
class
name
=
"EditorToolsFile.xml"
value
=
".read"
/>
</
classes
>
<
dialogParameters
></
dialogParameters
>
<
languages
></
languages
>
<
contextMenus
>
</
contextMenus
>
<
cssFiles
>
</
cssFiles
>
</
root
>
<!-- ==============================================================================================
The ToolsFile must have a valid structure as shown below
All attributes and their values are case sensitive!
<
root
>
<
modules
>
<
module
/>
<
module
/>
</
modules
>
<
tools
>
<
tool
/>
<
tool
/>
...
</
tools
>
...
<
colors
>
<
color
/>
<
color
/>
</
colors
>
</
root
>
<
tool
> element valid attributes:
name (required): Bold Italic Underline StrikeThrough Superscript Subscript
JustifyLeft JustifyCenter JustifyRight JustifyFull InsertOrderedList InsertUnorderedList
Outdent Indent Cut Copy Paste PasteFromWord
PastePlainText PasteAsHtml Print Undo Redo ImageManager
AbsolutePosition LinkManager Unlink InsertBoldHorizontalRule InsertTable ToggleTableBorder
FormatBlock ApplyClass FontName FontSize InsertCustomLink Custom
InsertSymbol BackColor ForeColor FlashManager MediaManager SpellCheck
FormatStripper InsertParagraph InsertSnippet Help FindAndReplace DocumentManager
PasteFromWordNoFontsNoSizes InsertFormElement InsertDate InsertTime TemplateManager ToggleScreenMode
Zoom ModuleManager ToggleDocking RepeatLastCommand AboutDialog
title
(not required):
Some hint string for this tool.
shortcut
(not required):
The key combination for the specific tool. Examples:
<
tool
name
=
"TemplateManager"
shortcut
=
"Ctrl+Shift+Alt+N"
/>
<
tool
name
=
"LinkManager"
shortcut
=
"Ctrl+L"
/>
<
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.
enabled (not required): true/false (Indicates whether the tool will be available on the client or not)
visible (not required):
true/false (Indicates whether the tool should appear in the toolbar or not. This toolbar will be available client-side - the property defines only the visibility of the tool.)
dockable (not required):
true/false (Indicates whether you will be able to drag&drop the toolbar to the docking zones)
<
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.
dockable (not required):
(Indicates whether you will be able to drag&drop the tool to the docking zones)
enabled (not required):
(Indicates whether the module will be available on the client or not)
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.
<
contextMenus
>
<
contextMenu
forElement
=
"A"
enabled
=
"false"
>
</
contextMenu
>
<
contextMenu
forElement
=
"P"
>
<
tool
name
=
"JustifyLeft"
/>
<
tool
name
=
"JustifyCenter"
/>
<
tool
name
=
"JustifyRight"
/>
<
tool
name
=
"JustifyFull"
/>
</
contextMenu
>
</
contextMenus
>
=============================================================================================== -->

I have been trying to get this work but for some reason all I could do is enable the tools from your file, the rest will not show, links, snippets etc. Just to clarify, are you trying to change the tools file for the default WYSIWYG editor in Sitefinity? I created a Configurations folder, placed the file in it, registered it as per the image and had to remove the toolbar names, otherwise only the first one was showing. After doing that all the tools were showing.
Regards,Atanas Valchev
the Telerik team

Why would you have to remove the toolbar names? Without the names, it wouldn't know what tool it is supposed to be.
I'm not sure what the snippets were supposed to be doing, but as long as we get the toolbar as it should look, it shouldn't really matter in my opinion.
So are you able to get the toolbar to appear as specified? Do you have an example of how to accomplish this? Is there a problem in Sitefinity that needs to be addressed?
I managed to change the toolbar used by from visual studio by either editing the RadEditor and using the Configuration Manager directly or setting the path to the tools file in the declaration. If you want to use the Configuration Manager then need to have no path to the tools file declared. Here is a screenshot: http://screencast.com/t/JC9ijW1fDM
Atanas Valchev
the Telerik team


Please review the following forum thread on the matter: http://www.telerik.com/community/forums/radeditor-customized-colors-with-own-description.
Best regards,
Rumen
Progress Telerik