I'm embedding a set of tag pairs with another set of tag pairs, but because there are two entries that meet the criteria of the outer tag pairs, EE's displaying the embedded tag pairs twice.
My code is as follows:
{exp:channel:entries channel="property_details" dynamic="no" status="open" orderby="random" limit="3" search:featured_property="=y"}
{if total_results < 3}
{embed="includes/homepage-properties"}
{/if}
{/exp:channel:entries}
What I'm trying to do is display three 'featured' entries when three or more exist (which is relatively simply using the search parameter in the tag and then an {if total_results > 2} within the tag.
When there aren't three results, I'm trying to just pick three non-featured entries at random as display them. I've embedded a template to enable me to use a tag pair within another, but this is then displaying that embedded template twice as there are two entries that meet the out tags criteria.
Any ideas on how to make it just display the embedded template once?