Saturday 03 March 2007 10:37:34 pm
Our site has a front page has two template includes which pull three articles each from another place in the system - we are using multiple locations to select the articles, they are given a second location in a hidden node and two templates included in the front page pagelayout then pull the first three articles by priority. Each item pulled gets the title of the article, a shortened version of the short description (with a link to the main article) and an attribute related image. The text bits work fine, but the images get processed throught the following templates:
design/news_site/templates/ezobjectrelation.tpl
design/news_site/templates/image.tpl design/news_site/templates/ezimage.tpl - and image.tpl sets (and overrides) the image alias. The problem is that the two inclusions need different image aliases. How do I call the image and get it to take the image alias in the foreach statement? BTW - I'm not sure of the validity of that h2 in the dd, but that can be addressed later, and yes, the title in the link is still a work in progress...
{def $highlights=fetch( 'content', 'list',
hash( 'parent_node_id', '434',
'sort_by', 'priority',
'limit', '3'
))}
{foreach $highlights as $highlight}
<dl class="smallhighlight">
<dt style="width:{$highlight.object.data_map.image.content[smallhighlights].width}px">
{attribute_view_gui attribute=$highlight.data_map.image image_class=smallhighlights}</dt>
<dd><h2>{attribute_view_gui attribute=$highlight.data_map.title}</h2>
{strip_tags( $highlight.data_map.intro.value.output.output_text ) | wash | shorten(50, '...', right)}
<a href={$highlight.url} title="more about {$highlight.data_map.title}">more»</a></dd>
</dl>
regards Paul Bolger <i>// please use tag for code snippets</i>
Paul Bolger
|