SubCatsRecurse
Recursively call the SubCategories or TopLevelCategories container with the subcategories of the category in context.
<mt:TopLevelCategories>
<$mt:CategoryLabel$>
<$mt:SubCatsRecurse$>
</mt:TopLevelCategories>
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.
Examples
The following code prints out a recursive list of categories/subcategories, linking those with entries assigned to their category archive pages.
<mt:TopLevelCategories>
<mt:SubCatIsFirst>
<ul>
</mt:SubCatIsFirst>
<mt:If tag="CategoryCount">
<li><a href="<$mt:CategoryArchiveLink$>" title="<$mt:CategoryDescription$>"><$mt:CategoryLabel$></a>
<mt:Else>
<li><$mt:CategoryLabel$>
</mt:If>
<$mt:SubCatsRecurse$>
</li>
<mt:SubCatIsLast>
</ul>
</mt:SubCatIsLast>
</mt:TopLevelCategories>
Related
- mt:SubCategories
- TopLevelCategories
- Understanding the Category Listing Code on Learning Movable Type