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

Apply CSS Class tool not picking up new classes

3 Answers 210 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 16 Jun 2014, 07:23 PM
We are using the Editor as the WYSIWYG for our client CMS. I am trying to make the layout inside the Editor window look as close to the real site as possible, so I am using the <CssFiles> feature to include some CSS, and the <classes> feature in the toolset XML to add custom classes to the Apply CSS Class menu. However, when I try to add new classes or edit old ones in the toolset XML, they are not getting picked up by the editor when I refresh the page.

Here is the code I am using to pull in CSS files into the editor window:
<CssFiles>
  <telerik:EditorCssFile Value="~/_EditorToolSets/bootstrap.css" />
  <telerik:EditorCssFile Value="~/_EditorToolSets/editor2.css" />
</CssFiles>

Bootstrap.css is the framework styles, the fonts css is for webfont support, and editor2.css is to define the custom styles I want the client to see in the window.

Here is the code from the toolset XML:
<classes>
<class name="Lead Paragraph" value=".lead" />
<class name="CAC Image" value=".cac-img" />
<class name="CAC Button" value=".cac-btn" />
</classes>

The only one that is working is the "Lead Paragraph" style. The others do not appear in the dropdown no matter what I do. I have tried changing the name of the toolset file to force a recache; cleaning and rebuilding the solution; and of course, viewing the page in a new browser to bypass cache issues.

Is there some kind of syntax rule I'm not aware of? Or limitations to the style sheets that can be added to the editor window using the <CssFiles> feature?

3 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 16 Jun 2014, 08:19 PM
It seems to be very tenacious about caching the CSS files that are declared in the Editor window. After making several changes to the editor2.css file I refreshed and inspected the editor window, and the version of the editor2.css file that is being loaded is not the most recent one. How can I force it to recache the CSS file?
0
Joshua
Top achievements
Rank 1
answered on 16 Jun 2014, 08:37 PM
It is DEFINITELY a CSS caching issue. I copied all my styles from editor2.css to a new CSS file and changed the declaration in the <CssFiles> block to that new file, and my classes appeared in the dropdown.

My question still stands, though... how can I force the styles to refresh? I can't rename the stylesheet every time I want to add a new style.
0
Ianko
Telerik team
answered on 17 Jun 2014, 07:19 AM

Hi Joshua,

Caching of the CSS files is a matter related to the browser and not the RadEditor itself.

I suggest checking for appropriate techniques to clear the cache in these materials:

On a side note, you can always manually clear the cache of the browser via the browser menu or dev toolbar.

Regards,

Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Joshua
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or