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

CssEditor.css included in Published View

3 Answers 85 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Morten asked on 05 Sep 2007, 07:13 AM
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.

3 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 05 Sep 2007, 09:26 AM
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
0
Borum.NET
Top achievements
Rank 1
answered on 25 Feb 2008, 09:59 PM
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
0
Lini
Telerik team
answered on 28 Feb 2008, 07:58 AM
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
Tags
WebParts for SharePoint
Asked by
Morten
Top achievements
Rank 1
Answers by
Lini
Telerik team
Borum.NET
Top achievements
Rank 1
Share this question
or