<mt:ArchiveList>

A container tag representing a list of all the archive pages of a certain type.

Attributes:

  • type or archive_type

    An optional attribute that specifies the type of archives to list. Recognized values are "Yearly", "Monthly", "Weekly", "Daily", "Individual", "Author", "Author-Yearly", "Author-Monthly", "Author-Weekly", "Author-Daily", "Category", "Category-Yearly", "Category-Monthly", "Category-Weekly" and "Category-Daily" (and perhaps others, if custom archive types are provided through third-party plugins). The default is to list the Preferred Archive Type specified in the blog settings.

  • lastn (optional)

    An optional attribute that can be used to limit the number of archives in the list.

  • sort_order (optional; default "descend")

    An optional attribute that specifies the sort order of the archives in the list. It is effective within any of the date-based and "Individual" archive types. Recognized values are "ascend" and "descend".

NOTE: You may produce an archive list of any supported archive type even if you are not publishing that archive type. However, the ArchiveLink tag will only work for archive types you are publishing.

Example:

    <mt:ArchiveList archive_type="Monthly">
        <a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a>
    </mt:ArchiveList>

Here, we're combining two ArchiveList tags (the inner ArchiveList tag is bound to the date range of the year in context):

    <mt:ArchiveList type="Yearly" sort_order="ascend">
        <mt:ArchiveListHeader>
        <ul>
        </mt:ArchiveListHeader>
            <li><$mt:ArchiveDate format="%Y"$>
        <mt:ArchiveList type="Monthly" sort_order="ascend">
            <mt:ArchiveListHeader>
                <ul>
            </mt:ArchiveListHeader>
                    <li><$mt:ArchiveDate format="%b"$></li>
            <mt:ArchiveListFooter>
                </ul>
            </mt:ArchiveListFooter>
            </li>
        </mt:ArchiveList>
        <mt:ArchiveListFooter>
        </ul>
        </mt:ArchiveListFooter>
    </mt:ArchiveList>

to publish something like this:

    <ul>
        <li>2006
            <ul>
                <li>Mar</li>
                <li>Apr</li>
                <li>May</li>
            </ul>
        </li>
        <li>2007
            <ul>
                <li>Apr</li>
                <li>Jun</li>
                <li>Dec</li>
            </ul>
        </li>
    </ul>
This page was last updated on 2012-12-30, 07:56.