Display an attribute of a data type

Author Message

Albe Terra

Tuesday 20 May 2008 2:46:22 am

Hi!
How can I display an attribute of a data type?
For example, I want to display the "alternative text" of an image as a caption. This is the code:

 

     {attribute_view_gui attribute=$node.data_map.image.content.alternative_text|wash(xhtml)}
 

Where's the error? Thanks, Albe

Maxime Thomas

Wednesday 21 May 2008 11:41:16 pm

Hi Albe,

A small explanation : the attribute_view_gui is a template function which allows you to automatically load a generic template for this attribute. It takes in argument the object attribute. Each nodes have a data_map array which is containing the attributes object which compose it.
So, to correct your code :

{$node.data_map.image.content.alternative_text|wash(xhtml)}

If you want to see what is inside an array or an object you can use :

{$node|attribute(show,1)}

Hope it helps.

Maxime Thomas
[email protected] | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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