Hi, All –
I have a question about custom styles in the RAD editor in MOSS (Microsoft Office Sharepoint Server) 2007. By custom styles, I mean those that show up in the “Apply CSS Class” drop-down in the editor. That drop down is currently populated with classes from “core.css” in the 12 hive, and optionally, “CssEditor.css” .
Ideally, I would like custom styles to be sub-site specific, not site-collection wide as they currently are . A content editor would have access to styles prepared specifically for their site, and not see styles in the drop-down intended for other site owners. In the out-of-the-box Microsoft editor, this was easily achievable because custom styles could be put in any style sheet, including those that were local to sub-sites, making locally customized styles a snap. Is there way to do this with the RAD editor as well? Thanks, and please respond if you need more clarification of my problem.
Scott DeMers
CUOnline, of at .
6 Answers, 1 is accepted

<property name="CssFiles">
<item>/_wpresources/RadEditorSharePoint/4.4.0.0__1f131a624888eeed/RadControls/Editor/CssEditor.css</item>
<item>/_wpresources/RadEditorSharePoint/AnotherCssFile.css</item>
</property>
This will make the list of available styles only those that are in the CSSs that you point to, excluding the ones from core.CSS.
I'll be watching for the answer to the second question, as I could use it, too!
M.
Generally speaking, it is possible to have different RadEditor configuration files for each SharePoint web on your server. You will simply need to create a new configuration file and append the unique ID of the web to the file name.
More information on the subject is available here.
Regards,
Georgi Tunev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Maybe it's a bit late but...
If you want to include contextual css files, you can do it that way:
public class MTIRadEditor : RadHtmlField |
{ |
protected override void OnLoad(EventArgs e) |
{ |
base.OnLoad(e); |
string urlSite = SPContext.Current.Web.Url + "/style collection/MetierWeb.css"; |
base.radEditorControl.CssFiles = new string[]{urlSite, "blabla" }; |
} |
} |
And use your new rad control in your pages
Hope it will help you
Sylvain
Thanks for the workaround. I just want to clarify, that it is possible to use it only in the WCM scenario (when adding the editor with SharePoint Designer). For the web part and list field scenarios, the only solution seems to be a separate config/tools file (Georgi's solution).
Sincerely yours,
Lini
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thanks
Yvonne
This should be relatively easy. First of all you need the full featured RadEditor for MOSS - I don't think it is possible to do this with the Lite version.
Create a new VS 2005 class project and add references to the RadEditorSharePoint and RadEditor.Net2 assemblies. The following page has information on how to extract the assemblies and add them in the VS 2005 project - http://www.telerik.com/help/radeditormoss/MOSSRadEditor.html. After that, you need to add your custom code and compile the project.
When you have the project assembly, you need to deploy it into the MOSS site collection:
1) copy the assembly into the MOSS web application's bin folder (e.g. \Inetpub\wwwroot\wss\VirtualDirectories\80\bin\)
2) if you get errors when you try to add the control in SharePoint Designer, edit the web.config file and set the trust level to Full. Don't forget to add <safeControl> entries as well.
Regards,
Lini
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center