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

[Solved] Linked Stylesheets in Edit Area

3 Answers 160 Views
Editor
This is a migrated thread and some comments may be shown as answers.
christopher willis
Top achievements
Rank 1
christopher willis asked on 29 Jan 2008, 07:01 PM

When I set ContentAreaCssFile="stylesheet.css" on the editor

The edit area iframe head tag actually ends up with 3 stylesheets linked:

<HEAD>
<STYLE></STYLE>
<LINK id=RADEDITORSTYLESHEET0 href="stylesheet.css" type=text/css rel=stylesheet>
<LINK id=RADEDITORSTYLESHEET1 href="IC/ICstyle.css" type=text/css rel=stylesheet>
<LINK id=RADEDITORSTYLESHEET7 href="/Web/RadControls/TabStrip/Skins/Office2007/styles.css" type=text/css rel=stylesheet></HEAD>


So the styles of all 3 sheets get combined.  I only want the first sheet used, as the others will not be present when this edited content is displayed.
Is this a bug or desired behaviour, and how can I work around?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Jan 2008, 05:33 PM
Hello Christopher Willis,

By default RadEditor copies all CSS and stylesheets from the page.

You could easily specify just the css files you want loaded in the editor by using its CssFiles property - this is how the editor will not pick up the styles from the parent page. The following online demo shows how to use the CssFiles property - Setting Content Area Defaults and External CSS Files.

In your scenario you can set the CssFiles property like this:

<telerik:RadEditor  
       ID
="RadEditor1"
       ContentAreaCssFile
="~/stylesheet.css"
       runat
="server">
</telerik:RadEditor>

Thus the editor will load only the styles in the stylesheet.css file.


Greetings,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
christopher willis
Top achievements
Rank 1
answered on 30 Jan 2008, 08:15 PM
From what I am seeing (1/15/08 build), 

ContentAreaCssFile="~/stylesheet.css"


Does not work as you described, as I get the 2 additional container page's stylesheets linked to the content frame.

However, 

<CssFiles>
<telerik:EditorCssFile Value="~/stylesheet.css" />
</CssFiles>

Seems to work better as I only get one additional CSS link, pointing to WebResource.axd








0
Accepted
Rumen
Telerik team
answered on 31 Jan 2008, 10:52 AM
Hi Christopher,

Please, excuse me for the mistake.

My suggestion was to use the CssFiles property, instead of ContentAreaCssFile, e.g.

<CssFiles>
    <telerik:EditorCssFile Value="~/stylesheet.css" />
</CssFiles>


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
christopher willis
Top achievements
Rank 1
Answers by
Rumen
Telerik team
christopher willis
Top achievements
Rank 1
Share this question
or