Forums / Setup & design / How to display Image class with extra url

How to display Image class with extra url

Author Message

Andreas Kaiser

Friday 22 December 2006 10:33:48 am

I've created a new content class similar to the image class, but with an extra datatype and the captation removed. The class has following structure:

1. Name [Text line]
2. Image [Image]
3. URL [Text line]

I can't use this code to show the image, because the url isn't "added" to the image.

{*{attribute_view_gui attribute=$random:item.object.data_map.image image_class='banner125'}*}

I've tried to use this code:

<a href="{$random:item.data_map.image_url.content}" title="xxx"><img src={$random:item.object.data_map.image.content[banner125].full_path|ezroot} alt="xxx" title="xxx" /></a>

My question is which code should I use for displaying the alt and title tag (with the alternative text field of the image datatype) or would there be another template code to show an image with an url...

Thanks and Happy Christmas to all the eZ Community!

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Betsy Gamrat

Friday 22 December 2006 10:56:14 am

Andreas,

I did something similar. I created a new class with a URL attribute called <b>link</b> and an image called <b>image</b>. These are the templates:

<b>image_link_full.tpl</b>

<a href={$node.object.data_map.link.content} target='_blank'>{$node.name}<br>{attribute_view_gui attribute=$node.object.data_map.image}</a>