Welcome to MTTags.com. Hopefully, you'll discover that this a really easy place to find information about Movable Type Template Tags. If you think we could be doing something better, please let us know! If this is your first time here, be sure to stop by the information desk, because we've got a growing todo list that might already include what you were about to suggest.

<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