I upgraded to Movable Type 3.2 before going live on Daggle and made a rude
discovery. My custom file name settings — my archive file paths — were
screwing things up. Short story: MT didn’t like the "rebuild safe" file paths
I’ve used on the Search Engine
Watch Blog.
The longer story is like this. When I started the SEW Blog, I initially used
the unique ID number each blog entry is given to make up the file name. Bad
move. Turns out that if you export your entries out of one MT setup and then
import them into a new MT setup, those entry numbers aren’t retained.
This was extremely annoying. The SEW Blog initially was on a single blog
setup. Then we moved it into a setup that operated multiple blogs. When we
imported everything, each SEW Blog entry was assigned ENTIRELY NEW entry
numbers! As a result, all the file names changed. Sucky, sucky, sucky!
After that, I decided I wanted a rebuild-safe naming structure. My solution
was to use the date and time of each entry to make up the file name. If you do
that, then Movable Type can always recreate your file names.
Specifically, I used this setting to make the file name for an individual
post, or an "individual entry archive" as MT calls it:
<$MTEntryDate format="%y%m%d-%H%M%S"$>.html
As a result, you’d end up with a file name such as:
050912-211726.html
Using this system, if you ever had to export your entries and move to a new
system, since the file name was based on the date and time, the file names get
recreated no problem. That’s because MT does retain each entries unique date and
time.
The only downside to this was that you could never change the time of an
entry. Do that, and you get a new file name. That hasn’t been a problem for us
on the SEW Blog. We just add a postscript or do an entirely new entry when
something fresh is needed. Also, you can never have two entries be done at
exactly the same time. Otherwise, they’ll stomp on each other and want the same
file name.
But with MovableType 3.2, I discovered the setting above no longer worked.
Trying to save a new entry gained me this error:
Error in <MTEntryDate> tag: You used an ‘MTEntryDate’ tag outside of the
context of an entry; perhaps you mistakenly placed it outside of an ‘MTEntries’
container?
Hmm, what could be doing that. Finally I thought perhaps the file path
structure was to blame. Changing all of my archive settings to one of the
suggested drop-down options, I got the error to go away.
But, what about those file names! How do I get to have the old file naming
structure? The solution was down to one small change, which I spotted when
reviewing the MT help
page on making archive paths. Rather than use MTEntryDate, you have to use
MTArchiveDate. I’ve bolded the part that changed below:
<$MTArchiveDate format="%y%m%d-%H%M%S"$>.html
Actually, further testing found that MTEntryDate works fine for making the
file names for Individual Entry Archives. But I had also used these other
settings:
- Daily Archives
<$MTEntryDate format="%y%m%d"$>.html
- Monthly Archives
<$MTEntryDate format="%y%m"$>.html
- Category Archives
<$MTArchiveCategory dirify="1"$>.html
MTEntryDate doesn’t work for the daily, weekly and monthly settings. I
shifted over to using MTArchiveDate, and all was fine. For the record, my final
setup is this:
- Individual Archive/Permalink
<$MTArchiveDate format="%y%m%d-%H%M%S"$>.html
- Daily Archives
<$MTArchiveDate format="%y%m%d"$>.html
- Monthly Archives
<$MTArchiveDate format="%y%m"$>.html
- Category Archives
<$MTArchiveCategory dirify="1"$>.html
By the way, why don’t I go with using the name keyword-rich base names that
Moveable Type will make? Because I don’t think keywords make that big of deal in
the URL for search engines, which is the main reason why you’ve seen these type
of systems evolve. Huh — aren’t keywords in the URLs crucial? No, they’re not
– see this SEW Forum
thread
for more on why.
Comments on this entry are closed.