My Goal: I have a «Topics»-Channel where every entry is a topic (like «Fruits») with multiple related entries (like «Apple», «Banana», «Peach»…) via the native Relationships-Module. On the entry-template where I display the «Apple»-entry, I want a list of all the related entry via the parent «Fruit». Like a «Table of Content» of «Fruits» with all fruits AND the current fruit (Apple) somehow highlighted.
My Problem: If I list all related entries with…
{parents channel='topics'}
<ol>{siblings channel='detail' field='topics-related'}
<li>{siblings:title}</li>{/siblings}
</ol>
{/parents}
… i only get a list of all OTHER entries, but without the current one … e.g. «Apple» in this case — I want the full list, and in the correct order.
Any Ideas?
Before switching to the native Relationships-Module, i used Playa and there I had this feature. Is it just not possible with «Relationships»? If so: who want’s to participate in a FR? 😉
From discussion in Slack, since you are looking of all children of a given parent, and not the siblings for the current entry, the rough pattern is to jump up to the parent and then just drill through all the related children as normal. Example:
{exp:channel:entries channel='player' limit='1'}
<h1>{title}</h1>
<h2>Full team</h2>
{parents field='team_roster'}
<ul>
{parents:team_roster orderby='player_position' sort='asc'}
<li>{parents:team_roster:title}: #{parents:team_roster:player_position}</li>
{/parents:team_roster}
</ul>
{/parents}
{/exp:channel:entries}
Would output something like this, while viewing the single entry for Mayberry Round:
<h1>Mayberry Round</h1>
<h2>Full team</h2>
<ul>
<li>Frank Caliendo: #01</li>
<li>Mayberry Round: #12</li>
<li>Todd Foo: #26</li>
<li>Joe Smith: #31</li>
<li>John Doe: #53</li>
</ul>
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.