This is a migrated thread and some comments may be shown as answers.
ToolsFile property not working
13 Answers 81 Views
This is a migrated thread and some comments may be shown as answers.
Ryan Dailey
Top achievements
Rank 1
Ryan Dailey asked on 20 Jun 2012, 09:09 PM
I am using Sitefinity 4.4, so this is occuring in whichever version of Telerik controls that is contained with that version.

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

Sort by
0
Ryan Dailey
Top achievements
Rank 1
answered on 22 Jun 2012, 02:10 PM
The version of controls I am using is 2011.3.1115.40.
Why is this not working?
0
Ryan Dailey
Top achievements
Rank 1
answered on 25 Jun 2012, 02:11 PM
Is there no solution to this? I'm not sure whether to blame the controls package or Sitefinity. Either way, I'm getting a little tired of all of the bugs that never seem to go away.
0
Atanas Valchev
Telerik team
answered on 25 Jun 2012, 04:11 PM
Hello Ryan,

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.

All the best,
Atanas Valchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ryan Dailey
Top achievements
Rank 1
answered on 26 Jun 2012, 01:49 PM
I tried what you suggested. The exception has gone away, but it's still not applying the custom toolbar. It's only showing the default.
0
Atanas Valchev
Telerik team
answered on 29 Jun 2012, 01:38 PM
Hi Ryan,

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

All the best,
Atanas Valchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ryan Dailey
Top achievements
Rank 1
answered on 29 Jun 2012, 02:45 PM
You are wanting to see my tools file? It's not letting me upload it. I'll just paste the markup here. Hope that helps.

<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>             
=============================================================================================== -->
0
Ryan Dailey
Top achievements
Rank 1
answered on 03 Jul 2012, 03:19 PM
Any ideas as to what may be going on? Is there a solution yet?
0
Atanas Valchev
Telerik team
answered on 04 Jul 2012, 02:16 PM
Hello,

 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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ryan Dailey
Top achievements
Rank 1
answered on 11 Jul 2012, 02:07 PM
The only editor I am trying change the toolbar for is the one I use directly inside my website. The WYSIWYG editor for Sitefinity is fine as it is.

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?
0
Accepted
Atanas Valchev
Telerik team
answered on 16 Jul 2012, 02:55 PM
Hello,

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 


Greetings,
Atanas Valchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ryan Dailey
Top achievements
Rank 1
answered on 13 Aug 2012, 01:34 PM
Thanks, I was able to get the toolbar to finally appear. Thanks for your help.
0
Divya
Top achievements
Rank 1
answered on 02 Apr 2018, 03:07 PM
The <color> element does not read the name or title properties and displays the hex value when hovered. Is there any altenative to display text instead of hex value for a color.
0
Rumen
Telerik team
answered on 02 Apr 2018, 04:07 PM
Hi Divya,

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Ryan Dailey
Top achievements
Rank 1
Answers by
Ryan Dailey
Top achievements
Rank 1
Atanas Valchev
Telerik team
Divya
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or