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

eZ debug

Timing: Jan 18 2025 16:17:37
Script start
Timing: Jan 18 2025 16:17:37
Module start 'content'
Timing: Jan 18 2025 16:17:37
Module end 'content'
Timing: Jan 18 2025 16:17:38
Script end

Main resources:

Total runtime0.9875 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.1641180.8281
Module start 'content' 0.00640.8468 769.9922574.1953
Module end 'content' 0.85330.1342 1,344.1875332.7734
Script end 0.9874  1,676.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3919210.0002
Check MTime0.00140.1401210.0001
Mysql Total
Database connection0.00070.073610.0007
Mysqli_queries0.924093.57371960.0047
Looping result0.00180.17951940.0000
Template Total0.962997.520.4814
Template load0.00170.176920.0009
Template processing0.961197.326220.4806
Template load and register function0.00020.015410.0002
states
state_id_array0.00090.086910.0009
state_identifier_array0.00100.105920.0005
Override
Cache load0.00140.1406190.0001
Sytem overhead
Fetch class attribute can translate value0.00140.145940.0004
Fetch class attribute name0.00120.124840.0003
XML
Image XML parsing0.00110.107440.0003
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00300.3015280.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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