MT file handling

I’ve been playing with Movable Type for a few weeks, trying to figure out how to associate uploaded files with individual posts, or even just an automatic way to place new files in a templated directory, and it doesn’t seem to be possible. The main problem appears to be that MT doesn’t really do files: the model is what I call accept and forget, which means it doesn’t care if you accidentally overwrite picture1.jpg uploaded two months ago with picture1.jpg taken today.

I suppose the reason I’m disappointed is partly because I’ve been thinking of MT as a content-management system, when all it is, really, is a weblogging tool–a very capable and flexible one, granted, but still just a tool. Given that Six Apart distribute it, uncrippled, for free, I hardly have a basis for complaining. It will be interesting to see if Movable Type Pro handles this any better, although based on Six Apart’s press about TypePad (features of which will be backported to MT Pro) I suspect it won’t.

Maybe I’ll need to take Tim Bray‘s advice after all: If you’re a programmer and you have a blog… buckle down and write the code yourself.

Movable Type trick

One of the (many!) nice things about Movable Type is its customizability. I didn’t realize just how far that extended until today.

I’d read previously in the MT UI that you can customize the output path for the archive files using Archive File Templates, and I’ve done so to provide more usable URLs based on the page title since just after I started Petroglyphs. Recently, I wanted to do a similar thing for another site, except that not all of the entries are guaranteed to have titles. Using my existing template, <$MTArchiveDate format="%Y/%m/%d"$>/<$MTEntryTitle dirify="1"$>.html, didn’t work because I wound up generating filenames like .html, but for a number of reasons (not least of all this) I didn’t want to add arbitrary characters or otherwise change the template.

MT plugins to the rescue. Brad Choate has written prolificly on MT, and developed a number of useful plugins that I’ve dutifully installed. The one that solved this problem, and made me appreciate MT more, is his MTIfEmpty. Basically what this does is check an expression–most often an MT tag itself–to see if it’s empty; the plugin also includes MTIfNotEmpty to do the opposite.

As it turns out, MT lets you use tags defined by plugins almost anywhere, not just in your page templates. (The one exception I’ve found is that you can’t use any tags directly in your entries–even built-in ones–although I’ve found a workaround for that too using another of Brad’s tools.) The practical upshot of this is that you can use plugins in your filename templates.

So without further ado, I present the template above, modified to use the filename untitled when appropriate: <$MTArchiveDate format="%Y/%m/%d"$>/<MTIfEmpty expr="[MTEntryTitle dirify='1']">untitled</MTIfEmpty><$MTEntryTitle dirify="1"$>.html

Quiet period 2

My self-imposed, somewhat accidental quiet period continues. There’s another reason now, about which I’ll say nothing more than it has to do with something from the There section of my homepage moving to the Here section… although it won’t really be here, exactly. More on that when it’s the proper time.

Cursive cursed?

Presented without comment for your perusal:

[Founder of Google Larry] Page: I’ve been waiting for them to start teaching searching, alongside spelling, in school.

…I can tell you that if my kids didn’t know how to search the Internet, I’d be worried. It’s a basic skill along with reading, writing and calculating.

Ernie the Attorney, via the shifted librarian

They’ve got good handwriting now, and they love cursive, Bolton says as her students filter in from recess. But it wouldn’t surprise me if they just walked around with their little keyboards and typed everything a few years from now.

Rachel Konrad (CBS), Penmanship: A Dying Art?”, via Slashdot

Quiet period

Not that all y’all (or even just y’all) care, but there are a few reasons for my recent lack of online presence.

Last weekend I went to Ottawa with my family to attend my brother’s convocation from the University of Ottawa. It was a fairly standard ceremony, enhanced by two facts: that it was held at the National Arts Centre, and most of all that it was my baby brother (if you know him, you’ll know how wrong that term is, and why I can’t call him my little brother either) walking across the stage. Congratulations Ed!

I actually have a couple of entries in progress, but haven’t found the time to finish and post them. One is a public posting of my response to a request my parents made–it’s been in the works since May 14–and the other is, ironically, all about my love of time. (It’s not started yet, but I want to put something up about touristy stuff in Ottawa.) Soon, my pretties, soon.

Things have been busy at work, and (horrors!) as a result I’ve been disinterested in doing anything on the computer at home. Yes, you read that right, and no, I’m not feeling particularly feverish, but thanks for asking.

And finally, I’ve spent more time talking, e-mailing and chatting with Jess in the last few weeks than with anyone else I’ve ever known. I’d blog some of our conversations, but they go too quickly and too long for even my 120+ wpm fingers to keep up… well, that and I get too involved in the discussions to be distracted by the browser, which to my mind is a Good Thing. Ain’t it funny how things will happen when you least expect them to?

Making one’s point

There is no pain too severe for the makers of this travesty. They are the offspring of dogs without genitals and maggots fed only on the excreta of diseased lizards. May Bolivian drug lords seize their only daughter as hostages in a tense geopolitical drama. May their next cruise-ship vacation remembered for the simultaneous outbreak of Norwalk Virus, an crunching encounter with an uncharted reef, and a record-breaking series of Nor’wester gales. May ruthless investment bankers place their retirement savings in airline shares. A green, crapulent, morbid, fulminating, metastasizing pox upon them!

Tim Bray, Lizard Excreta

Driving in Detroit

Scott Andrew LePera has a short anecdote about insane drivers that recalled an experience I had last summer.

My parents and brother and I had decided to take in a Tigers game at Comerica Park in Detroit–more to see the new stadium than out of any desire to see the team, I should point out, all of us being hardcore Blue Jays fans. So I was tooling down one of the relatively uncrowded city highways at 55mph (that’s 88km/h for anyone outside the U.S., or 147840 furlongs/fortnight) in my parents’ minivan when the taillights of the car in front of me came on and it jerked and started spewing smoke. It was only after I swerved, braked, and whatever else I wound up doing that we realized what happened: the guy shifted into reverse in the middle of the road!

Like Scott, I shudder to think what might have happened. If we’d been in heavier traffic or I’d been driving a little closer than I should have been things would have turned out differently.

It’s an experience I’m not eager to repeat.

De-marsmanned

marsman [f. the name of M. Marsman.] v., sl. Known in colloquial use among current and former employees of Liberate Technologies Canada since 2002.
To stop abruptly and without warning; to abandon.
2003 J. GREEN correspondence: Now who’s marsmaning [his weblog]?

1 out of 7

Sometimes I don’t understand this town.

Thanks Peter! You helped me enjoy the evening!!

May 15, Call the Office

You were 1 out of 7

John

Seven is a slight exaggeration; my friend Greg and I counted 12 people in the audience for John Mann‘s solo concert this evening.

John, in case you kinda recognize the name but don’t know from where, is one of the founders of Spirit of the West. He recently released a solo album, Acoustic Kitty, that has been in my car CD changer since the day I bought it. (The title and eponymous track take their name from a CIA research project that was almost comically unsuccessful.) Tonight’s performance was a solo acoustic show to a highly appreciative, if tragically small, crowd.

The performance highlight of the night for me was his encore, an a cappella version of Robert Burns’ To A Mouse that he wrote while performing in Of Mice And Men in Vancouver. The fanboy highlight, of course, was chatting with John for a couple of minutes after the show and having him sign a second copy of the CD; he’s a genuinely nice guy, and was gracious about the lack of an audience. I hope tonight’s show hasn’t turned him off London terribly, and that Friday’s performance at Ottawa’s Tulip Festival is better attended–my brother will be there (won’t you, Ed?).

Here are two short samples of what all but the 12 of us missed: Acoustic Kitty (ogg and mp3) and American TV (ogg and mp3).