MT Archive Customization

April 2nd, 2004

My good friend David is in the process of setting up his own Movable Type blog and had some questions about setting up archiving schemes. As I had not set any up I figured I’d give it a try. Here are my findings based on the “Hint 1″ at NSLog().
Here is perhaps a slightly more correct version of ‘Hint 1′ for archiving.

Under Weblog Config:
keep your “Local Archive Path” pointing to the absolute path to the archive directory: /home/html/mt/archives
and keep your “Archive URL” pointing to the archive directory on your server such that it would come up in a browser: http://www.example.com/mt/archives/

In the upper right hand part of the Weblog Config page there is a link to “Archiving” Click it.
On this page you should have two things checked, “Individual” and “Monthly”
In the text box for “Individual” Archive File Template place the following text:
<$MTArchiveDate format="%Y/%m/%d">/<$MTEntryTitle dirify="1">.html

This tells MT to store your files in sub-directories under “Archives” as defined on the main Weblog Config page. These sub directories are of the format Year/Month/Day/ and then your file is named by its title. So %Y/%m/%d turns into 2004/04/01 and then a slash is appended.

Next change the “Monthly” Archive File Template text box to:
<$MTArchiveDate format="%Y/%m/"$>index.html

This tells MT to build a page for each month of entries that is placed in the archives directory in sub directories of Year/Month/ and called index.html.
This means that if someone wants to see your entries for the month of March 2004 they would be directed to
http://www.example.com/mt/archives/2004/03/index.html

This is useful if you don’t want all of your blog entries stored in the same folder, or if you plan to have so many blog entries that it will be hard to navigate them in the future.

Keep in mind this only applies to the backend of the blog and your users won’t be the wiser, unless you are converting from having all your blogs in one folder. Then you run into the problem that this re-writes all of your permanent archives to a new folder structure.