I have some template code that used to work:
{exp:playa:children field="blog_related_entry" limit="5"}
{if count == 1}
<ul class="no-bullet">
<li>Related Entries</li>
{/if}
<li><a href="{site_url}blog/{url_title}" title="{title}">{title}</a></li>
{if count == total_results}
</ul>
{/if}
{/exp:playa:children}
I'm not sure when it broke, but with EE 2.8.1, Playa 4.5.2 this lists out the parent entry as a relationship 5 times, or 100 if there is no limit set. (I upgraded from Playa 4.1 in an attempt to solve the problem, I can't upgrade EE due to other issues.)
Any idea what's happening here?
-- Andris (accepted answer below) found it was a combination of needing to set var_prefix, entry_id and change the EE template tags - namely enclose the IF conditional fields in quotes and curly braces:
{exp:playa:children field="blog_related_entry" var_prefix="related_blog" entry_id="{entry_id}"}
{if "{related_blog:blog_published}"=="Yes"}
{if "{related_blog:count}" == 1}
<ul class="no-bullet">
<li>Related Entries</li>
{/if}
<li><a href="{site_url}blog/{related_blog:url_title}" title={related_blog:title}>{related_blog:title}</a></li>
{if "{related_blog:count}" == "{related_blog:total_results}"}
</ul>
{/if}
{/if}
{/exp:playa:children}