Image datatype

Author Message

David Santiso

Tuesday 22 March 2011 12:52:04 pm

Hi,

I've seen that when I add an image in a class using the image data type, it saves four copies with different sizes in var/ezflow_site/storage/images/...

When I show the image in a template ...

{attribute_view_gui attribute=$node.data_map.image}

... How can I choose another one of those pictures?

Philippe VINCENT-ROYOL

Tuesday 22 March 2011 1:10:22 pm

Hi David,

Are you sure to have image attribute on your class? Maybe check {$node.data_map|attribute(show, 1)}

Else you have a relation object .. check {$node.object.related_contentobject_array|attribute(show,1)}

Thats it :)

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

Damien Pobel

Tuesday 22 March 2011 1:13:37 pm

Hi David,

you can pass parameters to attribute_view_gui. In the case of image, you can write :

{attribute_view_gui attribute=$node.data_map.image image_class=medium}

to display the medium variation. You can look at the beginning design/standard/template/content/datatype/view/ezimage.tpl template to see what parameters are available.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

David Santiso

Tuesday 22 March 2011 1:41:17 pm

Thank you very much ;)

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