Forums / Setup & design / [Solved] Classes for images in OE

[Solved] Classes for images in OE

Author Message

Catherine Mollet @work

Tuesday 01 September 2009 2:14:24 am

Hello,
Again, a newbie question :-)
I would like to set a css class to some images via Online Editor and I understood that I have to add the classes in content.ini.append.php file. I succeded to add classes for links, paragraphs and even bold caracters, by using for example

[strong]
AvailableClasses[]
AvailableClasses[]=pink

but I'm unable to add classes to images. I tried with [embed] as I saw in several tutorials, but it applies only when I'm inserting an object (article for example), not when I'm inserting an image. As there's a [embed-type_images] in content.ini.append.php, I tried this too, but still no style appears when inserting or modifying image. Which one is the tag to set class ? Or is there something else to do ?

André R.

Friday 04 September 2009 1:24:29 pm

This is working for me (almost default values in settings/override/content.ini.append.php):

[embed]
AvailableClasses[]=itemized_sub_items
AvailableClasses[]=itemized_subtree_items
AvailableClasses[]=highlighted_object
AvailableClasses[]=vertically_listed_sub_items
AvailableClasses[]=horizontally_listed_sub_items
AvailableClasses[]=my_image_class

And if I want to limit that list for images (since all but the last one are for general objects), I can add (in same file):

[embed-type_images]
# Note: this needs to be defined in [embed] as well to work
AvailableClasses[]=my_image_class

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Catherine Mollet @work

Thursday 10 September 2009 4:59:13 am

Thanks André.
Well, I didn't guess for one second that I had to declare the new class both under [embed] AND [embed-type_images] ... And it works only if you put it on /root/settings/override/content.ini.append.php and not on /root/extension/my_site_design/settings/siteaccess/my_site/content.ini.append.php, as classes for links, etc. are OK in the second one...

paul bolger

Friday 12 February 2010 3:10:00 am

Is there a way to have a class set to a default of 'true' - be set for an element unless the user deselects it?

I've tried

AvailableClassesDefaults[myclass]=true

but it doesn't seem to work.

Paul Bolger

André R.

Wednesday 19 May 2010 10:28:55 am

You can set it up either in content.ini using:

[table]
Defaults[class]=myclass
# For custom attributes:
#CustomAttributesDefaults[<custom_attribute>]=<value>

Or using ezoe_attributes.ini where you can also specify a lot more on how attributes/custom-attributes are shown(see file in ezoe/settings for details).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Benjamin Bertrand

Friday 04 February 2011 3:32:26 pm

Following the first reply from André R., I was able to add a class of "slide" to my embed images, but only from /settings/override/content.ini.append.php.

When I used /extension/my_project/settings/content.ini.append.php this did not work.

Emmanuel Bichet

Wednesday 03 August 2011 7:41:46 am

@Benjamin : I had got the same problem as you. It's because the settings/override/content.ini.append.php reset the value of AvailablesClasses. To fix it, remove the line

AvailablesClasses[]
on the settings/override/content.ini.append.php file. Then your extension settings should prevail.

eZ debug

Timing: Jan 17 2025 19:51:28
Script start
Timing: Jan 17 2025 19:51:28
Module start 'content'
Timing: Jan 17 2025 19:51:30
Module end 'content'
Timing: Jan 17 2025 19:51:30
Script end

Main resources:

Total runtime1.7620 sec
Peak memory usage4,096.0000 KB
Database Queries212

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 596.0625180.8359
Module start 'content' 0.00811.5461 776.8984748.4375
Module end 'content' 1.55420.2077 1,525.3359340.6953
Script end 1.7619  1,866.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2405210.0002
Check MTime0.00150.0859210.0001
Mysql Total
Database connection0.00080.043310.0008
Mysqli_queries1.665294.50672120.0079
Looping result0.00250.14472100.0000
Template Total1.721597.720.8607
Template load0.00220.127220.0011
Template processing1.719297.573520.8596
Template load and register function0.00020.012810.0002
states
state_id_array0.00090.051010.0009
state_identifier_array0.00430.246020.0022
Override
Cache load0.00200.1121380.0001
Sytem overhead
Fetch class attribute can translate value0.00130.073360.0002
Fetch class attribute name0.00130.0732100.0001
XML
Image XML parsing0.00360.202160.0006
class_abstraction
Instantiating content class attribute0.00000.0013110.0000
General
dbfile0.00520.2943390.0001
String conversion0.00000.000930.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs