eZ Community » Forums » Setup & design » Fetching an image
expandshrink

Fetching an image

Fetching an image

Monday 14 March 2016 4:37:48 pm - 2 replies

Hi folks,

I am trying to fetch the URL/path of an image in an node, this is my code;

{def $info=fetch( 'content', 'node', hash( 'node_id', $Child:item.node_id) )}

1:{$info.data_map.title.content}<br>

2:{$info.data_map.image.content[original].url|ezroot}<br>

But the line 2: does not produce any output. Any ideas anyone?

Wednesday 16 March 2016 11:34:17 am

Hi,

Are you sure that your storage path is the same for front access and admin panel?

Please try dump your image attribute by {$info.data_map.image|dump()}

For future, you can consider using attribute_view_gui function instead of manually rendering attributes.

Regards,

MichaƂ

Thursday 17 March 2016 6:02:30 pm

Actually the solution was as simple as this:

{$Child:item.data_map.image.content.data_map.image.content[large].url|ezurl}

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from