MTSubCatCount

This template tag is the heart of the MT-SubCatCount plugin.

By placing it into your templates, you are able to retrieve a count of the number of entries found not only in the current category, but in the subcategories below the current one.

This tag also has two optoinal attributes that modify the value it returns.

The first such attribute is restrict, which when set will make the MTSubCatCount count only items in the current category - just like the MTCategoryCount tag.

<MTSubCatCount restrict="1">

This allows you to use the MTSubCatCount tag throughout your templates, whether you want the current category only or the current category plus all of the subcategories below it. The default behavior is to include the count of all subcategories.

The second attribute is variance, which you can use to adjust the counts at each level of category processed by the plugin.

<MTSubCatCount variance="-1">

Simply add the variance attribute to adjust the quantity at each level, for instance if you have found yourself creating placeholder entries and don't want to return those in your counts. The value can be positive or negative. The default behavior is to count all entries at every level returned.

MTIfSubCatCount

The plugin also provides a conditional tag that will allow you to display output only if the condition is met - in this case, if there is an actual entry count in a subcategory. Simply place the information you would like to display inside the container tags and if there is a count, it will display your content.

<MTIfSubCatCount>
<p>There are entries here!</p>
<MTElse>
<p>No entries to be found!</p>
</MTElse>
</MTIfSubCatCount>

This tag should be completely compatible with the MTElse tag in Movable Type, allowing you to display one value if there is a count and another if there is not.