Not a developer? Go to MovableType.com

Documentation

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”.

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 the result below (assuming Entries exist for the dates listed).

<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>

Version History

Movable Type version 4.2 introduced a bug where using this tag in a dynamic publishing environment would require that the selected Archive Type be enabled. This was fixed in 4.21. (Bug #82302)

Back

1 Comment

jerame

jerame on February 21, 2011, 10:31 a.m. Reply

I’m now using 4.35 and it’s broken again. Using Author-Yearly and Author-Monthly, the Author-Monthly tag doesn’t keep the Author-Yearly context - so, for each year, I get output of all the author’s monthly archives for every year.