Posted By

yasbas on 10/09/10


Tagged

object relations


Versions (?)

Extract content objects from relations object in an EZ Publish template


 / Published in: eZ Publish
 

The sidebar_box is an object of type relations object.

  1. {let attribute=$node.data_map.sidebar_boxes}
  2.  
  3. {section show=$attribute.content.relation_list}
  4. {section var=Relations loop=$attribute.content.relation_list sequence=array( bglight, bgdark )}
  5. {section show=$Relations.item.in_trash|not()}
  6. {let object=fetch( content, object, hash( object_id, $Relations.item.contentobject_id ) )}<br />
  7.  
  8. {section show=$object.main_node_id|null|not}
  9.  
  10. {$object.current.data_map.header.data_text}
  11. {$object.current.data_map.content.data_text}
  12.  
  13. <div class="image">{attribute_view_gui attribute=$object.current.data_map.media_library_object.content.contentobject_attributes.2}</div>
  14.  
  15. {/let}
  16.  
  17.  
  18. {/section}
  19. {/section}
  20. {section-else}
  21. {'There are no related objects.'|i18n( 'design/standard/content/datatype' )}
  22. {/section}
  23.  
  24. {/let}

Report this snippet  

You need to login to post a comment.