Changing CssClass Field in Advanced Mode to a Drop Down List

Posted by Community Admin on 03-Aug-2018 23:42

Changing CssClass Field in Advanced Mode to a Drop Down List

All Replies

Posted by Community Admin on 19-Oct-2011 00:00

Hi there,

Is there a way to change the 'CssClass' text field in advanced mode (of a content block) to a drop down list of pre-defined css class names?

My client is requesting this so they can change the background color and style of a content block quickly without knowing much html etc etc.

At first I added a custom css drop down list on the editor itself (using the toolsfile.xml method) but it doesn't seem to work efficiently.

If there is no way to directly change the cssclass property to a dropdown list, then could you let me know of an alternative way to allow them to do this.

It needs to be so that it changes the div class wrapper tag.

Many thanks,
Jamie

Posted by Community Admin on 21-Oct-2011 00:00

Jamie,

The Telerik guys may correct me in this, but you may have to create a custom Content block control to achieve something like that. Until, the Telerik guys come back to you with a better idea, here is a very bad idea for now.

In the CssClass field you can define multiple CSS classes with spaces inbetween. Specify all the classes that you need but spell correctly just the one that you currently need to be applied. That way, when you want to change the CSS class, you just mis-spell the current one and correct the spelling on the one you want. You can have a "1" at the end or something. How is that for a very bad idea?

I wish they had a poll for the worst ideas, this one would definitely win. By the way, I have not tried it at home myself, so no guarantees.

Thanks,
Andrei

Posted by Community Admin on 21-Oct-2011 00:00

Thanks Andrei,

Usually I would use this idea to solve my solution if I were the sole person needing to edit this field, but because non techy clients will be needing to edit this I can just see it getting all confusing for them and I'll end up having to change it anyway :)

I am interested in your idea about adding a custom content block though. Telerik, is this the correct way to go? and if so, could you provide a sample on how to do this please?

Many thanks,
Jamie

This thread is closed