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

Local Styles for "Apply CSS Class" drop-down.

6 Answers 174 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 26 Oct 2007, 08:08 PM

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

Sort by
0
Marc
Top achievements
Rank 1
answered on 27 Oct 2007, 04:04 PM
The answer to your first question is to you can open the ListConfigFile.xml and add the CssFiles property there:

<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.


0
Georgi Tunev
Telerik team
answered on 31 Oct 2007, 02:23 PM
Hello Marc,

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
0
viex
Top achievements
Rank 1
answered on 31 Oct 2007, 05:49 PM
Hello,

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
0
Lini
Telerik team
answered on 05 Nov 2007, 03:03 PM
Hi 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
0
Yvonne
Top achievements
Rank 1
answered on 03 Dec 2007, 11:33 PM
Based on Sylvain's code, it seems like there is a way to get customized RadHtmlField deployed in Moss. Can anyone share with us how to make it work?

Thanks
Yvonne
0
Lini
Telerik team
answered on 04 Dec 2007, 10:04 AM
Hi 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
Tags
WebParts for SharePoint
Asked by
Scott
Top achievements
Rank 1
Answers by
Marc
Top achievements
Rank 1
Georgi Tunev
Telerik team
viex
Top achievements
Rank 1
Lini
Telerik team
Yvonne
Top achievements
Rank 1
Share this question
or