how to get the sort number in relationship tag? the sort number is store in "order" in exp_relationships. I need it to sort my data. but have no idea how to retrieve it.
1 Answer
As posted here -- http://www.blue-dreamer.co.uk/blog/entry/ee2.6-new-relationship-tags -- you can use these variations of {count}
.
Related Entries
{custom_field}
{if custom_field:count == "1"}
<h2>Related</h3>
<ul>
{/if}
<li>{custom_field:title}</li>
{if custom_field:count == custom_field:total_results}
</ul>
{/if}
{if custom_field:no_results}No related entries{/if}
{/custom_field}
Parent Entries
{parents field="custom_field"}
{if parents:count == "1"}
<h3>Parents</h3>
<ul>
{/if}
<li>{parents:title}</li>
{if parents:count == parents:total_results}
</ul>
{/if}
{if parents:no_results}No parent entries{/if}
{/parents}
Sibling Entries
{siblings field="custom_field"}
{if siblings:count == "1"}
<h3>Siblings</h3>
<ul>
{/if}
<li>{siblings:title}</li>
{if siblings:count == siblings:total_results}
</ul>
{/if}
{if siblings:no_results}No results{/if}
{/siblings}