Forums / Setup & design / How to assign css class to image

How to assign css class to image

Author Message

Brian Hoke

Thursday 08 January 2009 12:59:30 pm

Please forgive a brand-new user what appears to be a most basic question: how to I associate a CSS class with an inserted image? That is, when I edit content (using the WYSIWYG editor) and insert an image from the media library, how do I assign that image a CSS class so I can (for instance) float the image left and wrap text around it? Thanks in advance for help.

Fátima Chapri

Sunday 11 January 2009 3:32:08 pm

Hi Brian,

I'm not shore if I understood you well. But here is a suggestion:
- If your image is inserted in the media library of the administration interface and you want to associate it as an object in an article, than you can add the fallowing code in the xml block:

<embed size="original" align="left" offset="0" limit="1" href="ezobject://your_embed_object_id" />.

I hope this can be useful for you.
If you any question, please ask.

Heath

Sunday 11 January 2009 7:01:11 pm

Hello,

You can assign a class when using the online editor's embed feature. The list of classes available to use with content comes from the 'AvailableClasses' array in any one of the settings block of content.ini and templates for the class (if applicable) in override.ini

Here is an example of two different styles which came with eZ Webin package.

<embed size="medium" view="embed" class="highlighted_object" align="center" custom:offset="0" custom:limit="5" href="ezobject://168" />

<embed size="medium" view="embed" class="vertically_listed_sub_items" align="center" custom:offset="0" custom:limit="10" href="ezobject://243" />

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org