Can I Control The Names Of My Files?
Question
I don't like the default filenames Movable Type assigns to my files. Can these be changed?
Answer
Yes, you can control these filenames.
Index Templates
For Index Templates, you can change the Output File name on the Edit Template screen.
Archive Templates
For Archive Templates, you can use Archive File Paths (on the Settings > Publishing screen, under Archive Mapping1).
This feature lets you customize the names/paths of your archive files, using standard Movable Type tags. This allows you to impose a directory structure and hierarchy on your archives. For each Archive Type that you use, you can define an Archive Path in the box to its right on the configuration screen.
By default, individual archive files are given a name based on the title of the entry (for example, an entry entitled 'Our Magnificent Day at the Beach' might be given the filename our_magnificent.html), and are stored in a directory based on the month of the entry (2004/05/our_magnificent.html). However, you may want to change the way your archive paths are formed.
For example, you may wish to impose a hierarchy on your archives, based on the category into which you've placed them; you might place all entries in the category Books into a directory called books/. To do this, you can use the following Archive File Path for your Individual Archive Type:
<MTEntryCategory dirify="1">/<MTEntryID pad="1">.html
Another example: by default, weekly archives are named using only the start date of the week (week_2002_01_06.html, for example). If you would like to include both the start and end dates in the filename, you can use the following Archive File Path for your Weekly Archive Type:
week_<MTArchiveDate format="%Y_%m_%d">-<MTArchiveDateEnd format="%Y_%m_%d">.html
Archive File Paths are defined using a subset of the standard Movable Type template tags. The following tags can be used in Archive File Paths:
<MTArchiveDate>and<MTArchiveDateEnd>for date-based archives (Monthly, Daily, Weekly)<MTArchiveCategory>for Category archives<MTCategory*>tags for Category archives- Any of the
<MTEntry*>tags for Individual archives
Note that when creating Archive File Paths using Movable Type Template Tags, you must append the file extension that you wish to use for your archive files (as in the examples above). The file extension that you specify in File extension for archive files will not be used.
As of version 3.2, you can also use Archive File Path Specifiers to aid in the creation of Archive File Paths.
IMPORTANT: After making changes, you will need to manually delete from your server any old files that use the original file names.
1 In versions prior to 3.2, navigate to Weblog Configuration > Archive Files, and look for the Archive File Templates column fields.


