Forums / Developer / Display an attribute of a data type
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 maxime.thomas@wascou.org | 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