Forums / Setup & design / Displaying object-image attribute in a template
Paul Wilson
Friday 16 May 2003 7:14:37 am
>>Situation: I have an node_id for an (image) class object, and I want to display the image.
I am working in pagelayout.tpl
>>Question:This seems like it should be a patheticly simple thing to do, but I just can't see it ! Any ideas or leads to useful documentation?
So far I can - Display the name of the image object with {$display:item.name}- Display the full/line object with {node_view_gui content_node=$Display:item}
However I can't get to the image attribute specifically...I've tried{attribute_view_gui attribute=$display:item.object.data_map.image}
But I don't think I've got the syntax right.
Many Thanks
Jo Henrik Endrerud
Saturday 17 May 2003 7:58:20 am
I assume that the attribute for the image is called "image"
{$display:item.data_map.image.content[large].full_path} will return the path to the image. Place this inside a <img> tag like this:
<img src={$display:item.data_map.image.content[large].full_path|ezroot} />
change large to medium, small or reference to get different sizes of the image.
BTW: I haven't checked this up, I'm writing just from my memory, but I'm almost 100% sure of the syntax. If this doesn't work let me know and I'll look it up (or use the |attribute(show) function to check how to get the path like this: {$display:item.data_map.image.content[large]|attribute(show)}
Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no
Sunday 18 May 2003 12:50:09 am
Thanks enormously! That's it!
Works wonderfully now. :-)