CODE
<MTCategories show_empty="1">
<p><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a> (<$MTCategoryCount$>)</p>
</MTCategories>
<p><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a> (<$MTCategoryCount$>)</p>
</MTCategories>
See the result in our Community Guide main page.
The problem with this is that if you click on the link for a category that has no entries, there will be no category archive, and you'll get a "Page Not Found" error. (In fact, the User Manual gives a warning about this very problem: "Note that this is [not] advised if you are including links to your category archive pages, because archive pages are not generated for empty categories. Thus, the archive link for an empty category will be a broken link.")
I was hoping there was a way to prevent the link from showing up if the category archive is empty. I tried to do it by using Brad Choate's MTIfNotEmpty tag to test whether there were entries, and then producing a link if there were, but not producing a link if there weren't (see my post elsewhere), but that approach doesn't seem to work.
Anyone have any suggestions on how else I might go about preventing the links from showing up for empty categories?
Thanks.