This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Displaying object-image attribute in...
expandshrink

Displaying object-image attribute in a template

Displaying object-image attribute in a template

Friday 16 May 2003 4:14:37 pm - 2 replies

>>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

Saturday 17 May 2003 4:58:20 pm

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)}

Sunday 18 May 2003 9:50:09 am

Thanks enormously! That's it!

Works wonderfully now. happy.gif Emoticon

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from