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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:36:23
Script start
Timing: Jan 18 2025 19:36:23
Module start 'layout'
Timing: Jan 18 2025 19:36:23
Module start 'content'
Timing: Jan 18 2025 19:36:25
Module end 'content'
Timing: Jan 18 2025 19:36:25
Script end

Main resources:

Total runtime1.3020 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 589.3672152.6250
Module start 'layout' 0.00440.0029 741.992239.4453
Module start 'content' 0.00731.2932 781.4375569.1172
Module end 'content' 1.30050.0015 1,350.554712.1563
Script end 1.3020  1,362.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2258160.0002
Check MTime0.00120.0921160.0001
Mysql Total
Database connection0.00070.053110.0007
Mysqli_queries1.255596.4296590.0213
Looping result0.00060.0473570.0000
Template Total1.273897.820.6369
Template load0.00200.156720.0010
Template processing1.271897.676820.6359
Template load and register function0.00020.017810.0002
states
state_id_array0.00110.080810.0011
state_identifier_array0.00150.116120.0008
Override
Cache load0.00170.1300190.0001
Sytem overhead
Fetch class attribute can translate value0.00070.051530.0002
Fetch class attribute name0.00250.192940.0006
XML
Image XML parsing0.00090.065530.0003
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00090.0673170.0001
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs