<$mt:SubFolderRecurse$>

Recursively call the <mt:SubFolders> or <mt:TopLevelFolders> container with the subfolders of the folder 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 subfolders that exist during the loop.

<mt:TopLevelFolders>
  <$mt:FolderLabel$>
  <$mt:SubFolderRecurse$>
</mt:TopLevelFolders>

Because folders are essentially categories for pages, most of the mtml category tags also work for folders.

Attributes

max_depth

Specifies the maximum number of times the system should recurse. Default is infinite depth.

Examples

Create recursive list of folders/subfolders, linking those with pages to the respective directory.

Note: Because folders don’t have archive templates, there is no <$mt:FolderArchiveLink$> because there is no guarantee that a page with the basename of index exists in the folder. Thus linking to the folder must be created manually using “<$mt:BlogURL$><$mt:FolderPath$>/”.

<mt:TopLevelFolders>
    <mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
        <mt:If tag="FolderCount">
            <li><h3><a href="<$mt:BlogURL$><$mt:FolderPath$>/"
            title="<$mt:FolderDescription$>"><mt:FolderLabel></a> (<$mt:FolderCount$>)</h3>
        <mt:Else>
            <li><h3><$mt:FolderLabel$> (<$mt:FolderCount$>)</h3>
        </mt:If>
        <$mt:SubFolderRecurse$>
        </li>
    <mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>

Same as above example but now listing pages in each folder, recursively.

<mt:TopLevelFolders>
    <mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
        <mt:If tag="FolderCount">
            <li><h3><a href="<$mt:BlogURL$><$mt:FolderPath$>/"
            title="<$mt:FolderDescription$>"><mt:FolderLabel></a> (<$mt:FolderCount$>)</h3>
        <mt:Else>
            <li><h3><$mt:FolderLabel$> (<$mt:FolderCount$>)</h3>
        </mt:If>
        <mt:Pages>
            <mt:If name="__first__"><ul></mt:If>
                <li><a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a></li>
            <mt:If name="__last__"></ul></mt:If>
        </mt:Pages>
        <$mt:SubFolderRecurse$>
        </li>
    <mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>
This page was last updated on 2009-07-15, 14:22.

3 Notes

See the Wiki Cookbook Template Tag recipes - Breadcrumbs for more.

I've updated docs for the `` tag with tested examples, they were horribly wrong.

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.