Forums / Setup & design / Image Align value

Image Align value

Author Message

paul bolger

Wednesday 05 September 2007 10:13:04 pm

I'm looking for the place the image align value (left, centre, right) gets stored - the one you can set in the embed dialogue . The image in question is embedded in the 'description' field of an article

$object.data_map.description.object.embedded_contentobject_array.0.current.data_map

I know it has to be in there somewhere!

thanks in advance.

Paul Bolger

Kristof Coomans

Thursday 06 September 2007 12:12:13 am

Hi Paul

In the embed tag view of ezxml (design/standard/templates/content/view/embed.tpl), there's this code

<div class="object-{$object_parameters.align}...

In the same template, $object_parameters is passed as well to the content_view_gui template:

{content_view_gui view=$view link_parameters=$link_parameters object_parameters=$object_parameters ...

So you can get it in your view template from $object_parameters.align.

Hope this helps. I'm not sure where you need the value of align, can you be more clear on that?
Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

paul bolger

Thursday 06 September 2007 8:51:08 pm

Hi Kristof

What I'm trying to do is extract the first (and only the first) embedded image in the description field, for a list of items in a folder, where having it return all embedded images would break the layout.

I've discovered that the following template code gets to that object, but it would be nice to be able to work out where in the object the embedded object parameters are stored. One application of this would be to be able to add a custom attribute: 'border', and to use this to add a CSS class to the image. This would allow a user to determine whether they would like a border on their image when they insert it.

$object.data_map.description.object.embedded_contentobject_array.0.current.data_map

My apologies if this sounds a little confused, but I've been trying to work out where the embedded contentobject parameters get stored for a while, and my current investigation makes me think I'm getting close - but I haven't found them yet!

Paul Bolger

Vidar Langseid

Friday 07 September 2007 7:31:48 am

I am afraid that what you are trying to do is not easy to accomplish

Basically, you are trying to extract embedding properties, but this is not available in the content objects itself. If you want to do this from templates I think you have to check the xml data itself (stored in {$node.object.data_map.description.content).

On way to go would maybe be to send that xml data to an new template operator which parses the xml and returns the alignment

eZ debug

Timing: Jan 18 2025 05:15:23
Script start
Timing: Jan 18 2025 05:15:23
Module start 'content'
Timing: Jan 18 2025 05:15:24
Module end 'content'
Timing: Jan 18 2025 05:15:24
Script end

Main resources:

Total runtime1.0250 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.6094180.8438
Module start 'content' 0.00780.8953 768.4531597.9063
Module end 'content' 0.90310.1218 1,366.3594337.3984
Script end 1.0249  1,703.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4149210.0002
Check MTime0.00170.1631210.0001
Mysql Total
Database connection0.00070.068710.0007
Mysqli_queries0.944192.10801990.0047
Looping result0.00220.21281970.0000
Template Total0.977595.420.4887
Template load0.00210.207220.0011
Template processing0.975395.156020.4877
Template load and register function0.00020.020210.0002
states
state_id_array0.00240.230410.0024
state_identifier_array0.00220.217320.0011
Override
Cache load0.00180.1760290.0001
Sytem overhead
Fetch class attribute can translate value0.00120.112540.0003
Fetch class attribute name0.00140.134460.0002
XML
Image XML parsing0.00130.130240.0003
class_abstraction
Instantiating content class attribute0.00000.001670.0000
General
dbfile0.00740.7248330.0002
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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs