Archive File Path Specifiers
The following are the recognized specifiers when creating Archive Mappings or formulating links to templates within the system.
Archive mappings are the paths Movable Type forms when it publishes a page. This is what determines for example what the URL to an entry on your blog will look like. Archive mappings are edited by navigating to the "Design > Templates" area of Movable Type. Then filter your list of template to view only "Archive templates." Then view or edit any of the templates listed there. At the bottom of the screen under "Template Options", all of the archive mappings associated with a template will be listed.
Tips
- Using a dash after the percent sign will cause the specifier to use dashes instead of underscores. If
%aproducesmelody_nelson, then%-awould producemelody-nelson. - MT template tags can also be used in the archive mapping. For example, if you wanted your entries to be published at a url like:
http://domain.com/2007/Sep/16/basename.htmlthen you could use this archive mapping<mt:EntryDate format="%Y/%b/%d" lower_case="1" />/%-f - In some cases shown below, uppercase variants exist and used to produce an alternate/shorter version of the value returned by the lowercase code letter.
Archive File Path Specifiers
%a
The entry's author's display name passed through the dirify global filter. Example: melody_nelson
%-a
The same as above except using dashes. Example: melody-nelson
%b
For individual archive mappings, this returns the basename of the entry. 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
%c
The entry's primary category/subcategory path constructed using category basenames. Example: arts_and_entertainment/tv_and_movies
%-c
Same as above but using dashes. Example: arts-and-entertainment/tv-and-movies
%C
Basename of the entry's primary category. Example: arts_and_entertainment
%-C
Same as above but using dashes. Example: arts-and-entertainment
%d
2-digit day of the month. Example: 09
%D
3-letter language-dependent abbreviation of the week day. Tue
%e
A numeric entry ID padded with leading zeroes to six digits. Example: 000040
%E
The entry's numeric ID. Example: 40
%f
Archive filename with the specified extension. This can be used instead of %b or %i and will do the right thing based on the context. Example: entry_basename.html or index.html
%F
Same as above but without the file extension. Example: filename
%h
2-digit hour on a 24-hour clock with a leading zero if applicable. Example: 09 for 9am, 16 for 4pm
%H
2-digit hour on a 24-hour clock without a leading zero if applicable. Example: 9 for 9am, 16 for 4pm
%i
The setting of the IndexBasename configuration directive with the default file extension appended. Example: index.html
%I
Same as above but without the file extension. Example: index
%j
3-digit day of year, zero-padded. Example: 040
%m
2-digit month, zero-padded. Example: 07
%n
2-digit minute, zero-padded. Example: 04
%s
2-digit second, zero-padded. Example: 01
%x
File extension with a leading dot (.). If a file extension has not been specified a blank string is returned. Example: .html
%y
4-digit year. Example: 2005
%Y
2-digit year with zero-padding. Example: 05

ob.myopenid.com
September 16, 2007 3:59 AM | Reply
I want to format my archives like this:
http://domain.com/2007/Sep/16/how-do-i-do-this.html
Note the abbreviated month - this is the bit I'm struggling to reproduce.
There seems to be some confusion between the options outlined on this page and those listed for date formats in templates http://www.movabletype.org/documentation/appendices/date-formats.html
I can't use:
%b The abbreviated month name. Example: Sep.
as this conflicts with:
%b For individual archive mappings, this returns the basename of the entry.
Is there another way of doing this?
Jay Allen
February 27, 2008 8:41 AM | Reply
I'm pretty positive that the descriptions for %c/%C variations are incorrect and outdated. The category path USED to be the dirified versions of the category/sub-category label but is now the category basename.
Beau Smith
June 4, 2008 8:28 AM | Reply
@jayallen » Thanks. Descriptions for %c/%C have been updated.
Beau Smith
June 4, 2008 8:47 AM | Reply
@ob.myopenid.com » you can use MT tags in the archive path as well.
If you want your entry archive mapping to be like this:
Then use this archive mapping (remove the lower_case modifier if you really want to have uppercase month in your url):