I've got a for loop that is returning the first letter of the entry title. I have a number of entries so I almost get a complete alphabet except that there are too many of many letters. I only want one 'a', one 'b', one 'c' and so forth. And no letter if there is no entry to correspond to it.
{% for alpha in craft.entries.section('advertisers').order('title asc') %}
<a href="{{ siteUrl }}{{ alpha.title|first }}">{{ alpha.title|first }}</a>
{% endfor %}
This code returns: A A A B B B B B C C E E E E G G H H K M M M M P P R R S S S T T U U U W W but I want it to return A B C E G H K M P R S T U W
Are there any solutions to this?