Chapter Subcategory
MTSubCatsRecurse
Recursively call the MTSubcategories or MTTopLevelCategories container with the subcategories of the category in context. This tag, when placed at the end of loop controlled by one of the tags above will cause them to recursively descend into any subcategories that exist during the loop.
Attributes:
- max_depth - An optional attribute that specifies the maximum number of times the system should recurse. The default is infinite depth.
Example:
The following code prints out a recursive list of categories/subcategories, linking those with entries assigned to their category archive pages.
<MTTopLevelCategories>
<MTSubCatIsFirst><ul></MTSubCatIsFirst>
<MTIfNonZero tag="MTCategoryCount">
<li><a href="<$MTCategoryArchiveLink$>"
title="<$MTCategoryDescription$>"><MTCategoryLabel></a>
<MTElse>
<li><MTCategoryLabel>
</MTElse>
</MTIfNonZero>
<MTSubCatsRecurse>
</li>
<MTSubCatIsLast></ul></MTSubCatIsLast>
</MTTopLevelCategories>
Or more simply:
<MTTopLevelCategories>
<MTCategoryLabel>
<MTSubCatsRecurse>
</MTTopLevelCategories>
Related
- Learning Movable Type: Understanding the Category Listing Code
- MTSubcategories
- MTTopLevelCategories


