Not exactly what you are looking for but it does use a break:
{if $this_node.data_map.image.content.is_valid}
{*has an image in the image attribute*}
<img src={$this_node.data_map.image.content.['medium'].url|ezroot} />
{elseif ne($this_node.object.related_contentobject_count,0)}
{foreach $this_node.object.related_contentobject_array as $related_object}
{if eq($related_object.class_identifier,"image")}
{*has an image as a related object*}
<img src={$related_object.data_map.image.content.['medium'].url|ezroot} />
{break}
{/if}
{/foreach}
{else}
{*got bubkis*}
<img src={"dummy.jpg"|ezimage}>
{/if}
Thanks Steven, That works well and was what I was looking for. Thanks too Jérôme. The documentation is a bit vague about how to use {break}, but now I understand. If only I could add a comment to the documentation so others could see what I've been shown...
Paul Bolger
You must be logged in to post messages in this topic!