Remove trailing comma from an output loop? I want to create a comma separated list of categories to which an entry belongs, but without the trailing slash on the last element... can't work out how to remove it!

{% for category in entry.mediaType %}
    &lt;b&gt;{{ category.title }}&lt;/b&gt;,
{% endfor %}
There is a special tag inside for loops you can use for this

{% for category in entry.mediaType %}
    &lt;b&gt;{{ category.title }}&lt;/b&gt;,
    {% if loop.last %}
        &lt;b&gt;{{ category.title }}&lt;/b&gt;
    {% endif %}
{% endfor %}


Full list here