This is a migrated thread and some comments may be shown as answers.

Load snippets from external XML file

1 Answer 86 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dave Miller
Top achievements
Rank 2
Dave Miller asked on 03 Jan 2008, 09:24 PM
I am using the default toolset and while I have added a few custom controls in the code behind (C#) I would like to be able to load the snippets from an external xml file. This way snippets could be added by someone as needed without C# experience or the need to rebuild the solution. Is this possible or would I need to use a complete Toolsfile.xml for this to work

Thanks,
Dave

1 Answer, 1 is accepted

Sort by
0
Accepted
Lini
Telerik team
answered on 04 Jan 2008, 08:18 AM
Hello Dave,

You have two options. You can either use the existing tools file functionality in RadEditor, or use the ASP.NET theming mechanism .

The RadEditor "Prometheus" control maintains backwards compatibility with the old RadEditor for ASP.NET so you can use virtually the same ToolsFile.xml in the new editor as well. The problem with this approach is that you must define all the editor tools in the tools file as well and also the people who change the snippets will also be able to change the editor tools. If you decide to use this approach, then in the code you simply need to set the ToolsFile editor property (a sample tools file is attached to this message):

RadEditor1.ToolsFile = "~/Tools.xml";

The second way to do this takes advantage of ASP.NET themes. Create a theme and add a skin file for the RadEditor control. In this skin file you can configure all RadEditor properties, including snippets. To enable these settings, simply set the page theme in your application. I have attached a sample RadEditor.skin file to this message. If you want to have different snippets for different pages, you can place multiple RadEditor definitions in the skin file and use different SkinID properties.

Kind regards,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Dave Miller
Top achievements
Rank 2
Answers by
Lini
Telerik team
Share this question
or