Friday 17 February 2006 8:40:20 am
I'm implementing a template for a summary view of a Article object, which can have various kinds of related objects, but I only want to show one related objects of type Image. I was surprised that class_filter_type can not be used with fetch(content, related_objects). This works:
{def $img=false()}
{section loop=fetch(content, related_objects, hash( object_id, $article.object.id))}
{section-exclude match=true()}
{section-include match=$:item.class_name|eq('Image')}
{run-once}
{set $img=$:item}
{/run-once}
{/section}
But it seems rather cumbersome. Is there an easier way to do this?
|