Forums / Setup & design / Only link to image shown

Only link to image shown

Author Message

Roger Schmidt

Saturday 12 August 2006 4:52:08 pm

Hi all

When using following code in template only link to image is shown instead of image itself:

{attribute_view_gui attribute=$node.object.data_map.image image_class="small"}

Following template is automatically taken for the image when using code above:
design/standard/templates/content/view/text_linked.tpl

Any hints?

eZ Publish version 3.8.3, Apache 1.3, PHP 4.4.3RC3-dev, WinXP Pro.

Thanks,
Roger

Xavier Dutoit

Sunday 13 August 2006 3:25:26 am

Hi,

It uses the default template instead of the one for images. That's defined in the override.ini.append.php of your siteaccess

X+

http://www.sydesy.com

Roger Schmidt

Sunday 13 August 2006 4:37:17 am

Thanks Xavier.

Which is the most suitable template for image display I could use? There are hundreds of templates around and when looking on their code I get a little bit confused (at least for the moment).

If possible this template should take image_class into account (image_class="small") - as parameter in example?

Regards,
Roger

Roger Schmidt

Sunday 13 August 2006 5:04:19 am

As a test I have just copied the template found in base/override/templates/embed/image.tpl into mysite/override/templates and renamed it to line_view_gallery_article_image.tpl.

And there is a new entry in override.ini.append.php:

[line_view_gallery_article_image]
Source=content/view/text_linked.tpl
MatchFile=line_view_gallery_article_image.tpl
Subdir=templates
Match[class_identifier]=article
Match[section]=6

There are already other entries in this ini file for same class_identifier and section, and they work as supposed.

Inline template debugging tells me that still design/standard/templates/content/view/text_linked.tpl is used for image display! All caches were cleared.

In the debug notices below the actual website design/plain_site/override/templates/line_view_gallery_article_image.tpl is listed (but not as used template).

Regards,
Roger

Roger Schmidt

Sunday 13 August 2006 5:20:01 am

Nothing...

My earlier post suddenly disappeared, so I posted same entry again, but now I cannot delete this entry here, only change the content!

Roger Schmidt

Tuesday 15 August 2006 1:05:41 pm

Is there anybody around who can help with this issue?

Thanks,
Roger

Softriva .com

Tuesday 15 August 2006 1:28:17 pm

I had the same issue before. Check out this post.
http://ez.no/community/forum/general/attribute_view_gui

Roger Schmidt

Tuesday 15 August 2006 1:56:55 pm

Thanks Oozy, but this did unfortunately not solve the problem. Still showing only link.

Did you have to edit anything in override.ini.append.php as Xavier mentioned in his post for using another default template for images?

When clicking on the link, the default object view is shown. The corresponding image can be seen there. Meaning, in general showing images should work in my eZ publish environment.

There are no error messages in debug output (only translation warnings and notices).

Best regards,
Roger

Roger Schmidt

Tuesday 15 August 2006 3:24:12 pm

Finally, I got the solution. :-)

It is a good idea to look at the settings of admin interface. I have found an entry for embeded images in its override.ini.append.php:

[embed_image]
Source=content/view/embed.tpl
MatchFile=embed_image.tpl
Subdir=templates
Match[class_identifier]=image

I added same entry in corresponding override.ini.append.php for my site, and adapted following for overwriting default template for images of my site (text_linked.tpl):

[embed_image]
Source=content/view/text_linked.tpl
MatchFile=embed_image.tpl
Subdir=templates
Match[class_identifier]=image

Template embed_image.tpl was copied from design/admin/override/templates to template directory of my site.

Regards,
Roger