Not a developer? Go to

MT5 Documentation

Archive File Path Specifiers

Archive File Path Specifiers are used when creating Archive Mappings and formulating links to files published by the Archive Templates within the system.

Archive mappings are the paths Movable Type creates when it publishes a files using an archive template. Archive mappings determine the URLs of all file published by the archive templates: entries, pages, monthly archives, etc.

One template may have multiple mappings; the author and author-monthly files may be published by the same template and have some conditional logic (mt:If, mt:Else, mt:Unless, etc) using archive template variables.

To create a "Monthly" archive mapping such as:


...use %y for a 4-digit year, %m for a 2-digit month, and %i for the default index file name. Separate the specifiers with forward slashes denoting the path:


To create a "Category" archive mapping such as:


...use %-c for a dash-separated category path and and %i for the default index file name separated by slashes like this:


To create an "Entry" archive mapping like this:


...use 4-digit year, 2-digit month, and entry basename with the archive file extension specified in publishing preferences:


Archive File Path Specifiers are used by various Movable Type tags that create links (such as the mt:EntryPermalink tag). When an archive mapping ends with the the directory index--a combination of IndexBasename and the archive file extension specified in publishing preferences, which is "index.html" for most servers--Movable Type will remove it from the url.

Thus if the actual paths to an entry and a monthly archive are like this:


Then Movable Type will create links (respectively) to the above files without the directory index filename:

<a href="2008/12/entry-basename/"><!-- foo entry --></a>
<a href="2008/12/"><!-- foo monthly archive --></a>

Common Archive Paths

The below archive paths suggested values in Movable Type. The default option for each archive type is in bold.

Archive Type Archive Path Specifier String

Editing Archive Mappings

Archive Mappings are found under "Template Options" at the bottom of each archive template.

  1. Navigating to "Design > Templates".
  2. Edit an archive template such as: Entry, Entry Listing, Monthly Entry Listing, etc.
  3. At the bottom of the screen click "Template Options" to reveal the archive mappings associated with a template.

Using Template Tags in Archive Paths

Movable Type template tags can be used directly in the archive mapping.

For example, to publish entries at a URL like:


Use the mt:EntryDate tag which has additional date formats to produce the archive mapping like this:

%y/<$mt:EntryDate format="%B"$>/%d/%-f

or output the whole date and slashes using the tag:

<$mt:EntryDate format="%Y/%B/%d"$>/%-f

Warning: users should be aware that the use of template tags, while advantageous in some circumstance, carries with it some risks. There is no absolute guarantee that the output of a template tag and any combined modifier like dirify="1" will be consistent from one version to the next. If you rely on template tags in your archive mappings, please play close attention to the Movable Type change log prior to upgrading to anticipate any changes to relied upon behavior.*


  • Using a dash after the percent sign will cause the specifier to use dashes instead of underscores. If %a produces melody_nelson, then %-a would produce melody-nelson.
  • In some of the cases the uppercase variants exist and can be used to produce an alternate version of the value returned by the lowercase specifier.

Archive File Path Specifiers


The author basename (<$mt:AuthorBasename$>. Example: melody_nelson


The same as %a.


The same as above except using dashes. Example: melody-nelson


For individual archive mappings, this returns the <$mt:EntryBasename$>. By default, this is the first thirty characters of an entry dirified with underscores. It can be specified by using the basename field on the edit entry screen. Example: my_summer_vacation


The same as %b.


Same as the above but uses dashes instead of underscore. Example: my-summer-vacation


Same as the above but uses dashes instead of underscore. Example: my_summer_vacation


The primary category/subcategory path of an entry constructed using category basenames (<$mt:SubCategoryPath$>. Example: arts_and_entertainment/tv_and_movies


The same as %c.


Same as above but using dashes. Example: arts-and-entertainment/tv-and-movies


The basename of the primary category of the entry (<$mt:CategoryBasename$>. Example: tv_and_movies


Same as above but using dashes. Example: tv-and-movies


2-digit day of the month. Same as <$mt:ArchiveDate format="%d"$>. Example: 09


3-letter language-dependent abbreviation of the week day. Same as <$mt:ArchiveDate format="%e" trim="1"$> Example: Tue


A numeric entry ID padded with leading zeroes to six digits. Same as <$mt:EntryID pad="1"$> Example: 000040


The numeric ID of the entry. Same as <$mt:EntryID pad="0"$> Example: 40


Archive filename with the archive file extension specified in publishing preferences. This can be used instead of %b or %i and will do the right thing based on the context. Same as <$mt:ArchiveFile$>. Example: entry_basename.html or index.html


Same as %f but using dashes. Example: entry-basename.html


Same as "%f" but without the file extension. Same as <$mt:ArchiveFile extension="0"$>. Example: entry_basename


Same as "%f" but without the file extension and using dashes. Same as <$mt:ArchiveFile extension="0" separator="-"$>. Example: entry-basename


2-digit hour on a 24-hour clock with a leading zero if applicable. Same as <$mt:ArchiveDate format="%H"$>. Example: 09 for 9am, 16 for 4pm


2-digit hour on a 24-hour clock without a leading zero if applicable. Same as <$mt:ArchiveDate format="%k" trim="1"$>. Example: 9 for 9am, 16 for 4pm


The setting of the IndexBasename configuration directive with the default file extension appended. Same as <$mt:IndexBasename extension="1"$>. Example: index.html


Same as %i but without the file extension. Same as <$mt:IndexBasename$>. Example: index


3-digit day of year, zero-padded. Same as <$mt:ArchiveDate format="%j"$>. Example: 040


2-digit month, zero-padded. Same as <$mt:ArchiveDate format="%m"$>. Example: 07


3-letter month. Same as <$mt:ArchiveDate format="%b"$>. Example: Sep or Jan


2-digit minute, zero-padded. Same as <$mt:ArchiveDate format="%M"$>. Example: 04


Current page number. Same as <mt:PagerBlock><mt:IfCurrentPage><$mt:Var name="__value__"$></mt:IfCurrentPage></mt:PagerBlock>


2-digit second, zero-padded. Same as <$mt:ArchiveDate format="%S"$>. Example: 01


File extension with a leading dot (.). Same as <$mt:BlogFileExtension$>. If a file extension has not been specified a blank string is returned. Example: .html


4-digit year. Same as <$mt:ArchiveDate format="%Y"$>. Example: 2005


2-digit year with zero-padding. Same as <$mt:ArchiveDate format="%y"$>. Example: 05