The Movable Type User Manual

NOTE: This documentation is for Movable Type 3.2. If you are using a newer version, please see the documentation for Movable type 3.3x or Movable Type Enterprise.

« Editing a Template using an External Editor | Up | Creating an Alternate Archive Template »

Chapter 3: Templates and Layout

Controlling the Naming of Archive Pages

Problems

You want to control the naming of files for a particular archive template.

Solution

Modify the template's Archive File Path on the Publishing Settings tab.

Discussion

The Archive File Path allow you to customize the names/paths of your archive files. This allows you to define a directory structure and file naming from a weblog's archives. For each Archive Template that you use, you can define an Archive File Path in the pulldown menu to its right on the Publishing Settings tab. This pulldown includes a number of common options to choose from based on the archive type.

Also included is a "Custom" option that lets you define an Archive File Path Template. These templates are defined using a subset of the standard Movable Type template tags. The following tags can be used in Archive File Path Templates:

  • MTArchiveDate and MTArchiveDateEnd for Date-based archives (Monthly, Daily, Weekly)
  • MTArchiveCategory and MTCategory tags for Category archives
  • Any tags for Individual archives

For instance, you may wish to file away posts in your archives based on their category. So all entries assigned to the category "Books" would get placed into a directory called books/. To implement this with an Archive File Path Template, you would use the following markup for your Individual Entry archives:

 <$MTEntryCategory dirify="1"$>/<$MTEntryID pad="1"$>.html

This template will output file names like:

 books/000007.html
 books/000040.html
 books/000072.html

When using Archive File Path Templates, you must append the file extension that you wish to use for your archive files. The file extension that you specify in your settings will not be used.

I assume this is now gone, however a pulldown menu option should exist.

(Note that users of previous Movable Type versions can choose backward-compatible filenames in Weblog Config.)

We should mention why not. Jay?

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.