Share » Forums » Setup & design » Fetching an image from related...

Fetching an image from related objects of different kind

Fetching an image from related objects of different kind

Friday 17 February 2006 8:40:20 am - 1 reply

Author Message

Marc Boon

Sunday 19 February 2006 10:54:55 am

I found a simpler way:

{foreach $article.object.related_contentobject_array as $object}
{if $object.class_name|eq('Image')}
{def $img=$object}
{break}
{/if}
{/foreach}

I was a bit confused by the old-style and new-style syntax. Many examples use {section}, {default} and {let}, which seem all be deprecated. Being a PHP programmer, the new syntax looks a lot more familiar :)

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

36 542 Users on board!

Forums menu