SubFolders
A specialized version of the Folders container tag that respects the hierarchical structure of folders.
Attributes
include_current
An optional boolean attribute that controls the inclusion of the current folder in the list.
top
If set to 1, displays only top level folders. Same as using TopLevelFolders.
sort_by
Specifies the sort key. The following options are available. This attribute was introduced in Movable Type 5.1.
- label
- description
- baseame
- createdon
- modifiedon
- user_custom
The default value is user_custom. It produces the sort order you specified on the Manage Folders screen.
This attribute is ignored if sort_method has been set.
Display a reversed list of top-level folders sorted by the label:
<mt:SubFolders top="1" sort_by="label" sort_order="descend">
<!-- do something -->
</mt:SubFolders>
sort_order
Specifies the sort order. Values “ascend” (default) and “descend”.
sort_method
An optional and advanced usage attribute. A fully qualified Perl method name to be used to sort the folders.
Examples
The following code lists folders and pages hierarchically.
<mt:TopLevelFolders>
<mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
<mt:If tag="FolderCount">
<li><$mt:FolderLabel$> (<$mt:FolderCount$>)
<mt:Pages sort_by="title" sort_order="ascend">
<mt:PagesHeader>
<ul>
</mt:PagesHeader>
<li class="page page-<$mt:PageID$>"><a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a></li>
<mt:PagesFooter>
</ul>
</mt:PagesFooter>
</mt:Pages>
<mt:Else>
<li><$mt:FolderLabel$>
</mt:If>
<$mt:SubCatsRecurse$>
</li>
<mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>