CssEditor.css included in Published View

4 posts, 0 answers
  1. Morten
    Morten avatar
    3 posts
    Member since:
    Jan 2006

    Posted 05 Sep 2007 Link to this post

    Now after I've upgraded to 4.3.2.0, the CssEditor.css file that I use to style elements inside the editor, is also referenced by a <link> tag in published view as the visitors sees the page.

    Thats a problem because some elements are styled differently inside the editor. Why is that and can i avoid it somehow?

    I know i can prefix all my selectors in the CssEditor.css with .RadEContentBordered, (ie. .RadEContentBordered H1{color:red;}), but i would've liked it a little cleaner than that.

    Regards, Morten.
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 05 Sep 2007 Link to this post

    Hello Morten,

    This is the default behavior of the MOSS editor since version 4.3.0. The CssEditor.css file will be loaded both in presentation and authoring modes.

    If you want to have styles just for authoring mode, then you can separate them in another css file and tell the editor to load it as well. The second css file will not be loaded in presentation mode. Here is how to do that:

    Add the following property to the editor configuration file:

    <property name="CssFiles">
        <item>/_wpresources/RadEditorSharePoint/4.3.2.0__1f131a624888eeed/RadControls/Editor/CssEditor.css</item>
        <item>/_wpresources/RadEditorSharePoint/4.3.2.0__1f131a624888eeed/RadControls/Editor/CssEditor2.css</item>
    </property>

    As you can see, the property specifies which CSS files to load in the Apply Class dropdown. In this case the editor will load two files - CssEditor.css and CssEditor2.css. As you already know, the CssEditor.css file will also be loaded in presentation mode, but the CssEditor.css file will only be used when the editor is on the page.


    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  3. Borum.NET
    Borum.NET avatar
    9 posts
    Member since:
    Apr 2005

    Posted 25 Feb 2008 Link to this post

    Hi Lini

    I was wondering why you're insisting on including the CSS file in the published view? Is there really no way of turning it off?

    Thanks in advance
    Anders Borum / ProActive
  4. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 28 Feb 2008 Link to this post

    Hello Anders,

    There is no way to turn off loading CssEditor.css in presentation mode. As I said in the previous message, you will need to create a second CSS file and put the styles you wish to see only in the editor there.

    The file was actually not loaded in presentation mode in the first RadEditor for MOSS version, but we received a lot of complaints by customers, who want to get the same look in authoring and presentation modes. Since it is not always easy to add the file manually to the page (e.g. if you are using the editor web part), we had to change the code and load the file automatically.

    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top