<$mt: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>
This page was last updated on 2009-06-22, 16:27. [Edit]

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.