Cooking with Webstandards! Taste the full flavour of the Web

Next entry: Discover a lost art: Play Marbles | Previous entry: Easter Shots

User friendly URLs with MovableType

This is the thing I wanted to do most when I started playing around with MT. User-friendly URLs. But how to do it? I thought it would be best, if the individual archive pages would be named similar than the page title. And suddenly I remembered about the <$MTArchiveCategory dirify="1"$> that made the category archive path look like cat_name_of_category/.

What is that dirify attribute doing, you might ask? Well, let me quote the MT User Manual:

When set to "1", dirifies the tag value. This means that the value of the tag is made suitable for usage in a file or directory name: the value is converted to lower case, HTML tags and entities are stripped, strange characters are stripped (where strange is defined as not included in the following set: alphanumeric characters, underscore (_), and whitespace), and whitespace is then converted to underscores (_).

The same thing would probably fit well for the individual pages. Said some Trial and Error. The Entry's title has to be displayed. So let's try the following:
<$MTEntryTitle dirify="1"$>.php

Quickly rebuilt the site and guess what?? It worked. Cheers, Yells. So the permalink to this entry should be:

And it did. Now that's great news, isn't it? For all of you who can figure out these things better when shown an image, here's a screenshot of the change I made:

Screenshot of the Movable Type Archive Configuring menu

Please note that you should choose the file extension you configured in your main weblog config menu (so probably you have to change .php to .htm or whatever).

However, I wasn't satisfied with the underscores. Have to keep in mind that Google doesn't treat underscores like a word-separator, while it recognizes dashes. So I wanted to change these underscores to dashes. After some search, I found out about the dirifyplus plug-in for MT. And that did the job. If you're interested, instructions and download options for this plugin are located here.

Posted by Minz Meyer at April 20, 2004, 04:01 PM | To Top

Other ingredients

This is great info! Thanks a lot for sharing it and doing all the research. Your blog is wonderful, when I get more time I'll check out the whole thing.

Posted by: Valerie at April 21, 2004 05:05 PM | Let Cool (this ingredient)

Very cool, Minz. You are a champ.

This is the kind of thing -- as well as "how to get rid of those annoying pop-ups" -- that I should probably have in the class. It's hard to know on first run-through what's necessary. Thanks for being a patient guinea pig. :) [Do they have that expression, over there?]


Posted by: Kynn Bartlett at April 22, 2004 06:49 AM | Let Cool (this ingredient)

Kewl . . . This is great. Applying Kynn's suggestion for the Category archives to the Individual Entry archives is ingenius . . . ~smacks self in the head for not thinking of it first~. Now to go apply it to mine. Oh and thanks for the link to the dirifyplus plugin. I see I'm going to have to go to the MT Plugin Directory and check out what else I can use ~grin~.

Kynn may call you a guinea pig . . . but to me your a fountain of information.

Posted by: Miss B at April 23, 2004 02:34 AM | Let Cool (this ingredient)