I've searched the EE forum archives and have been unable to find a solution to a problem I'm having. I have a custom category field that I'm using to determine placement of category links throughout my website (e.g main nav, supporting links, etc). This is working fine, however, my issue is that I'd like to not write the ',' after the category link (see code snippet below) if its the last category to be displayed of those that are flagged to show. I can't use {count} and {total_results} vars here since I don't know up front which categories will need to be displayed (based on the custom field). If these were channel entries, I could use the search:field_name option to filter the entries and then use count and total_results vars, but that doesn't exist for the channel:categories tag. Any ideas of how to solve this one? I'm running EE 2.5.5
{exp:channel:categories style="linear" category_group="3"}
{if nav_location == 'Display in primary and header navigation'}
<a href="{path="{category_url_title}"}">{category_name}</a>,
{/if}
{/exp:channel:categories}