Here is my solution:
<mt:entries lastn="9999">
<mt:entrydatacountry setvar="country">
<mt:var name="countries{$country}" value="1">
</mt:entries>
<ul>
<mt:loop name="countries" sort_by="key">
<mt:if name="__key__"><li><mt:var name="__key__"></li></mt:if>
</mt:loop>
</ul>
<mt:entrydatacountry setvar="country">
<mt:var name="countries{$country}" value="1">
</mt:entries>
<ul>
<mt:loop name="countries" sort_by="key">
<mt:if name="__key__"><li><mt:var name="__key__"></li></mt:if>
</mt:loop>
</ul>
First it loops over all entries, storing the country as the key in a hash. This gets rid of duplicates. Then it loops over the hash, displaying the keys (ignoring the empty key, if there was an entry with no country set).
If the blog is very large, I would recommend setting up this snippet of template code as a module with caching turned on and processed as a server side include. This module could then be included either directly or in a separate index template, the output of which could then be included via a 'manual' server side include as well. The advantage of using a dedicated index template for this is that it could be set to use background publishing, which would improve backend performance even more on a large blog.
Tweet
Thanks, Maarten
This worked perfectly! I was able to easily replicate for my "Cities" custom field as well. Very nice, thanks again for jumping in and helping. It looks great.
I'll come back and post a link to the site once it launches.
Brian (birdahonk)
I am sure you'll find more stimulating. i am a http://www.earthsfriends.com/types-of-salamanders ware of ugg boots uk cheap sale Boris pretty well ugg b http://www.cetreria.com/foro/viewtopic.php?f=10&t=70062 oots uk .
http://www.earthsfriends.com/types-of-salamanders
http://www.cetreria.com/foro/viewtopic.php?f=10&t=70062
http://gnathletic-fc.cu.cc/online/viewtopic.php?f= http://gnathletic-fc.cu.cc/online/viewtopic.php?f=10&t=235209 1