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