I am the greatest genius the world has ever known.
...
Okay, that might be going a bit too far. But I'm still pretty slick. Over my winter break, I've been working on moving my Dream Log over to MovableType, so I can do neat things like cross-reference them and sort them by theme or motif. And it'll make updating easier; before, I've been going through and coding in each and every one by hand. (Which isn't all that bad, just a lot of cutting and pasting, really, once I have the text in mind.) I switched over to stylesheets at some point, and have meant to go back and update all the old entries to use them too, but that would be a lot of work. And I mean a lot. So what the heck, I said to myself, why not move everything to MovableType and enjoy uniform formatting and quick, painless font changes?
So far, it's going pretty well, all except for the main index page, which I don't like. I'll do something about it soon.
There was one little hitch, though...When I'd done everything manually, I'd used a different background image for all of my dreams that'd involved Canada. Because I like Canada. As you may have gathered from the way I talk about it constantly. (Converts are always the most zealous.) But how could I make that work in MovableType? All the entries would use the same template. I had a special Canada category set up; could I insert if-then statements into my template using MovableType data? The answer, I learned, was 'No.' But there was a way! A way almost supremely adapted to my filing system. The primary category I'd assigned to each entry was the year, since that's how I'd filed them back in the Olden Days. So it wouldn't be unreasonable to copy my original stylesheet a few times, and name the copies after these yearly categories. Then I could very cleverly switch the primary category of my Canada dreams from their year to Canada, and make the years secondary. Then I could build a new and different Canada stylesheet. And--now here's the clever bit--I could go into my Individual Entry Archive template, and change the link to the stylesheet from the original stylesheet's name to
<$MTEntryCategory$>.css
When an entry is built, it'll look for a stylesheet with the same name as its primary category. Genius!
Of course, I find that someone else has already thought of this. But who gives a fig? I'm still a genius.
Behold. Here is a regular entry. Here is a Canada entry. Taste the difference.
Posted by aloysius at January 02, 2004 03:59 PM | TrackBack |