Megalomania and other virtues

October 24, 2007 Digital Experience
So you have a SUV, 8 bedroom house, and by far the biggest office in the company… the areas at which you can display your natural gift for overdoing are shrinking at the distressing pace. Fear not, for I will show you how to modify the blog post editor in Sitefinity to display every single command it can.

In order to fully grasp what are we about to do, please take a look at the RadEditor in it’s full glory.



So, we decided that we want to pimp up the editor for inserting new blog posts as well as the one for editing already existing blog posts. Since everything you see in Sitefinity (be it admin area or public controls) has its underlying template, we need to locate the two templates in charge of inserting and editing blog posts.

Open the ~/Sitefinity/Admin/ControlTemplates/Blogs/ControlPanelInsert.ascx and ~/Sitefinity/Admin/ControlTemplates/Blogs/ControlPanelEdit.ascx files. Each of these templates has exactly one instance of RadEditor control, which definitely narrows it down when locating the right one. If you are familiar with Telerik RadEditor you know that you can set the ToolsFile (tools file is an xml file that defines which commands will be available in RadEditor) property for the RadEditor.

Now let’s set the ToolsFile property to “~/Sitefinity/Admin/ControlTemplates/Blogs/EditorToolsFile.xml” (this file does not exist yet, we are going to paste it there in the next step). Do this for editor in Insert template as well as for the one in Edit template.

The RadEditor control should look more or less like this (the ToolsFile property is the only one that matters for this post):

<radE:RadEditor runat="server" ID="contentEditor" ConfigFile="~/Sitefinity/Admin/ControlTemplates/EditorConfigFile.xml" ToolsFile="~/Sitefinity/Admin/ControlTemplates/Blogs/EditorToolsFile.xml"
Width="95%">
</radE:RadEditor>


In ~/Sitefinity/Admin/ControlTemplates folder you'll find EditorToolsFile.xml file – this is the tools file used by all the Sitefinity editors by default. Copy that file to the ~/Sitefinity/Admin/ControlTemplates/Blogs folder (remember that's the location that we've set our RadEditors to look for tools file).

Almost there, all we need now is some magic. Open that file that you've just pasted and replace all the words „false“ with „true“. Basically you’ll be setting the values of “visible” and “enabled” properties.

Armed with the knowledge that Sitefinity admin area can be modified to fit your specific needs you could decide to do something that actually makes sense, but that is beyond the scope of this post. Way beyond…

Disclaimer : No Usability Experts were harmed during the writing of this blog post.

The Progress Team