Fieldtype

Archived
Forum
(read-only)

Expresso

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5

Back to this add-on's main page
View Other Add-ons From PutYourLightsOn

     

Adding styles to elements [resolved]

General

Tyssen
Tyssen

Is there a way using buttons from the toolbar to assign classes to particular elements? For example, if I’m adding images via the file button, how can I attach a class (for left or right alignment) without editing the HTML.

PutYourLightsOn
# 1
Developer
PutYourLightsOn

once you’ve inserted the image, select it and then click on the image icon. there is an option to add a class under the advanced tab.

Tyssen
# 2
Tyssen

Is there any way to choose from a predefined set of classes or IDs, rather than having to type them in? For instance with TinyMCE, you can include a styles dropdown which you populate from the js config.

PutYourLightsOn
# 3
Developer
PutYourLightsOn

Espresso uses CKEditor which also allows you to predefine a style set. the docs for this are here.

Tyssen
# 4
Tyssen

Actually, I think I’d prefer to use the method described at http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles#Stylesheet_Parser_Plugin but that requires CKEditor 3.6. Can I just update the CKEditor folder or is Expresso only licenced to be used with a certain version?

Also, I’m quite new to CKEditor and not sure which file needs to be edited to add these new configuration options.

PutYourLightsOn
# 5
Developer
PutYourLightsOn

i haven’t tested CKEditor 3.6 with Expresso so you’ll have to try at your own risk (backup the original CKEditor folder). Expresso is licensed with all CKEditor versions so no problem to use 3.6. i may consider adding this in a future major release but i have no experience with the plugin you mentioned so can’t advise you on how to integrate i’m afraid.