Forums / Setup & design / Display a related image

Display a related image

Author Message

Rémy-Christophe Schermesser

Monday 10 July 2006 10:14:43 am

Hi,

I have tried to display a simple image for all day.

I have a class with contains related images (like ine the article class).

All I want is to display my image (visuel2.jpg)

So i wrote that (I've found this multiple time on the forum) :

{attribute_view_gui attribute=$node.children[1].object.data_map.image image_class=original}

But I get that :

<a href="/index.php/media/images/site/folder/visuel2">visuel2</a>

I've tried this

{$node.children[1].object.data_map.image.view_template}

to have the name of the template to override, so I've tired to override it but I could not.

So can you help display my simple image ? What do I need to do ?

Thank you very much for your help.

Rcs

Łukasz Serwatka

Monday 10 July 2006 11:06:16 pm

Hello Rémy-Christophe,

Use code:

{attribute_view_gui image_class=original attribute=$node.children[1].data_map.image.content.data_map.image}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Rémy-Christophe Schermesser

Tuesday 11 July 2006 1:02:04 am

Hi,

I have already tried that and it does not work at all.

Łukasz Serwatka

Tuesday 11 July 2006 1:13:50 am

{attribute_view_gui image_class=original attribute=$node.children[1].data_map.image.content.data_map.image}

Works fine here. Do you have any errors/warnings in debug output? Did you clear the cache after template changes? And make sure that $node.children[1] is correct.

{$node.children[1]|attribute(show,1)}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Rémy-Christophe Schermesser

Tuesday 11 July 2006 1:26:30 am

I clear the cache everytime :)

{$node.children[1]|attribute(show,1)} display the attributes of the correct object that contains my image.

The only errors I have in the debug output is that :

Error: eZTemplate  	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

Error: eZTemplate 	Jul 11 2006 10:21:30

Unknown template variable 'node' in namespace ''

I do no understand where to look to correct these errors

Christian Johansen

Wednesday 12 July 2006 3:57:29 am

You are using the $node object in a template that does not override a template in the node/ hierarchy, most likely your pagelayout.