Content Management
Different templates for different categories
Freshness Warning
This blog post is over 20 years old. It's possible that the information you read below isn't current and the links no longer work.
9 Sep 2004
Here’s some more cleaning out my idea database. This is yet another half-conceived idea that if you want to take it, flesh it out, and run with it, it’s yours.
I get asked on occasion how to get Movable Type to use a different templates for each category on the blog. Now that you can segment your site with subcategories, I suspect that more people will want to do this. So here’s a rough outline of how. Please don’t link to this as a tutorial. I don’t want confused MT users to have to sift through my barely coherent ramblings. But if you want to write up a tutorial on how to do this, put a link to it in the comments.
You can have as many category templates as you want. Create a different one for every category.
You can have MT create a different archive file for each template.
Instead of using the category link tags that MT provides, create your own links to the category archive file you want to use for a particular category.
So you might create a category template called news and one called products. Then you change the archive filename format in the MT preferences to output two sets of archive files. One using your news templates and one using the products template. Then in your site, you change the links from <MTArchiveLink> to a manual link like /path/to/the/news/archive/files
So your links now point to a different set of templates depending on what category you want.