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

7 posts, 0 answers
  1. Scott
    Scott avatar
    4 posts
    Member since:
    Oct 2007

    Posted 26 Oct 2007 Link to this post

    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, University of Colorado at Denver.

  2. Marc
    Marc avatar
    21 posts
    Member since:
    Oct 2007

    Posted 27 Oct 2007 Link to this post

    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.



  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 31 Oct 2007 Link to this post

    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
  4. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 31 Oct 2007 Link to this post

    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
  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 05 Nov 2007 Link to this post

    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
  6. Yvonne
    Yvonne avatar
    4 posts
    Member since:
    Nov 2007

    Posted 03 Dec 2007 Link to this post

    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
  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 04 Dec 2007 Link to this post

    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
Back to Top