I want to modify the Rich Text Editor used by Sharepoint on my publishing page. I've created my Javascript files and image files, and created a modified version of RTE2ToolbarExtension.xml - I'm ready to go.
If I add the files to my Layouts folder manually, and then customise the RTE2ToolbarExtension.xml within the catalog/masterpage/Editing Menu folder, it all works a treat - my buttons appear and work as desired. However, this manual approach is obviously not the ideal way of doing it, so instead I created a feature to make the changes instead.
The first problem is that I can't overwrite a file within the catalog masterpages via a feature, so my workaround is to rename the existing file first. At the moment I'm doing that manually but ultimately this will be done via a feature activation event. Now when I activate my feature, I get my updated version of RTE2ToolbarExtension.xml added to the catalog. However, when I try to edit my publishing page, Sharepoint throws the following XML Exception:
"Data at the root level is invalid. Line 1, position 1
So it's unable to read my new version of the XML file, even though the contents are *exactly* the same as they were after I manually updated it.
Any suggestions why that might be? My ElementManifest file contains the following:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="EditingMenu"
Url="_catalogs/masterpage/Editing Menu"
Path="EditingMenu"
RootWebOnly="TRUE">
<File Url="RTE2ToolbarExtension.xml" Type="Ghostable" IgnoreIfAlreadyExists="TRUE"/>
</Module>
</Elements>