Share » Forums » Developer » image_class not working (eZ publish...

image_class not working (eZ publish 4.1.0)

image_class not working (eZ publish 4.1.0)

Tuesday 24 November 2009 2:33:42 am - 2 replies

Modified on Tuesday 24 November 2009 3:01:15 am by Akhilesh Singh

Author Message

Jo Henrik Endrerud

Wednesday 25 November 2009 1:37:18 am

First a small comment. These two lines means exactly the same. Remove the section as it is reduntant.

{if $node.data_map.masthead_images.content.is_empty|not}

 

{section show=$node.data_map.masthead_images.content.is_empty|not}

When it comes to your question: As I understand it $node.data_map.masthead_images is an attribute of a related object. When you are using the attribute_view_gui you are then trying to view a link to an object, while what you really want to do is to view the image in the object that masterhead_images is pointing to. The correct code would be something like this:

{attribute_view_gui attribute=$node.data_map.masthead_images.content.data_map.image ...

I here assume that the attribute holding the image in the related object is called 'image'

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Sylvain Gogel

Wednesday 25 November 2009 1:09:46 pm

actualy the tpl used for attribute_view_gui ( http://pubsvn.ez.no/websvn2/filedetails.php?repname=nextgen&path=%2Fstable%2F4.2%2Fdesign%2Fstandard%2Ftemplates%2Fcontent%2Fdatatype%2Fview%2Fezimage.tpl ) also check if image is empty or not, so you can remove the {if} too

{attribute_view_gui attribute=$node.data_map.masthead_images.content.data_map.image
   alignment=left
   image_class=small
   css_class=profile
   href=$node.url_alias}

@ezp core developper the tpl used /design/standard/templates/content/datatype/view/ezpimage.tpl could benefit a param to link image to node.

@akhi you should also enable debug / display used template list and check what template is used for your attribute_view_gui, it may happen that you have a override that use another tpl than the standard

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu