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

Adding Classes to the Css drop down

4 Answers 110 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 29 Sep 2011, 10:44 PM
Hi,

I am trying to customize the CSS classes availalble on both the Image Properties Dialog and the Hyperlink Manager.
I've tried following the instructions here:
http://www.telerik.com/help/aspnet-ajax/editor-css-styles.html


By adding:
<CssClasses>
       
<telerik:EditorCssClass Name="Clear Class" Value="" />
       
<telerik:EditorCssClass Name="link" Value="a.link" />
       
<telerik:EditorCssClass Name="img" Value=".img" />
       
<telerik:EditorCssClass Name="redtext" Value=".redtext" />
   
</CssClasses>

But the only CSS class is the built in "Clear Class". I've tried adding via the tools file, external css file, and using the .Add Method. 
No luck with any. 
Any help would be appreciated.

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Oct 2011, 01:25 PM
Hello Rick,

The purpose of the CssClasses collection is to restrict the CSS classes to be loaded in the Apply Class dropdown. In order to load CSS classes in the CSS dropdowns you should define them in the page with the editor or import them via the CssFiles property.

Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Craig Tarr
Top achievements
Rank 2
answered on 21 Oct 2011, 03:32 PM
Rumen, is there a way in this version of the control to default CSS Class selector to a specific item? On Load it's set to Apply Class, I want to always default it to a custom class. 

I was able to do this previously Apply CSS OnInit

I'm searching the demos and documentation but haven't found a clear example yet.


Thanks,
Craig
0
Rumen
Telerik team
answered on 25 Oct 2011, 02:08 PM
Hello Craig,

You can write a custom content filter that will apply the desired className to the desired HTML elements in the content area. The filter will be executed when switching to HTML mode or when submitting the content.

Of course you can modify the built-in dialogs and implement the requested functionality. The following demo shows how to register the external dialogs and customize the LinkManager.ascx dialog: Customize Built-in Dialogs.

You can also attach to the OnClientPasteHtml event and modify the inserted via the LinkManager HTML content before it is pasted in the content area.


All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Craig Tarr
Top achievements
Rank 2
answered on 04 Nov 2011, 06:23 PM
Thanks Rumen!
We followed your second suggestion.


To set the value of the CSS Class to always be selected I added the following ELSE clause to the LInkManger.ascx file. In the _loadCssClasses

if (currentLink.className != null && currentLink.className != "") {
                this._linkCssClass.updateValue(currentLink.className);
                this._emailCssClass.updateValue(currentLink.className);
            }
            else {
                this._linkCssClass.updateValue("acceptPromo");
            }
Tags
Editor
Asked by
Rick
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Craig Tarr
Top achievements
Rank 2
Share this question
or