tips and tricks for movable type
preventing links to empty category pages
December 03, 2002
In this thread, Eduardo wanted to know how to list all the category archives in his blog, without having a link to the archive page if there were no entries in the category. We tried lots of things, and I finally found a PHP solution.
But Kevin Shay's new Compare plugin did the trick as well.
First, of course - install the plugin.
<MTCategories show_empty="1">
<p><b><MTIfNotEqual a="[MTCategoryCount]" b="0" numeric="1">
<a href="<$MTCategoryArchiveLink$>">
</MTIfNotEqual>
<$MTCategoryLabel$>
<MTIfNotEqual a="[MTCategoryCount]" b="0" numeric="1">
</a>
</MTIfNotEqual>
</b> (<$MTCategoryCount$>)</p>
</MTCategories>
<p><b><MTIfNotEqual a="[MTCategoryCount]" b="0" numeric="1">
<a href="<$MTCategoryArchiveLink$>">
</MTIfNotEqual>
<$MTCategoryLabel$>
<MTIfNotEqual a="[MTCategoryCount]" b="0" numeric="1">
</a>
</MTIfNotEqual>
</b> (<$MTCategoryCount$>)</p>
</MTCategories>
Whoomp! There it is!
Comments
Whoomp!
Thanks (again), Girlie!