- Code: Select all
<cms:set following_count="<cms:related_pages field='following' count_only='1'/>"/>
<cms:set followers_count="<cms:reverse_related_pages masterpage='members/index.php' field='following' count_only='1'/>"/>
Be mindful of the context in which you use this code. You should be able to place it directly in the members/index.php page view to display stats for each member. If you wish to display stats for the logged-in member, you will need to wrap the code with cms:pages (demonstrated below). To output a list (instead of a count) of the members in each case, simply remove count_only='1' and insert content like you would normally to list cloned pages:
- Code: Select all
<cms:pages masterpage='members/index.php' id=k_member_id limit='1'>
<h4>You are following:</h4>
<cms:related_pages field='following'>
...
</cms:related_pages>
</cms:pages>
It's unfortunate that the ids_only and count_only parameters haven't been documented as they are immensely useful.