Blog redesign, episode 5

I’ve just fin­ished imple­ment­ing nice urls. No more data­base IDs fol­lowed by .php — now it’s date based using yyyy/mm/dd/post_title_based_on_title.

And it wasn’t that hard. In MT 3.11 you just go to your Weblog Con­fig and untick “Use Old-Style Archive Links” under Pref­er­ences to get your archives into date mode. Under Archive files you can put < $MTArchiveDate format="%Y/%m/%d"$>/< $MTEntryTitle dirify="1"$> in your indi­vid­ual entry archive file tem­plate (with­out .php) to strip your archive pages for the file exten­sion. Only prob­lem is, that if you rely on your pages to be parsed as php (as I do, I’m includ­ing some side­bar stuff) you need to get .htac­cess to parse your extension-less pages as php…which proved a bit more dif­fi­cult than I’d expected. Dalager helped me out (again), point­ing me to ForceType application/x-httpd-php which — as you might have guessed — sim­ply forces every­thing to be parsed as php. That did the trick; an .htac­cess file with just that line is now dumped into my archives folders.

Pre­vi­ously I didn’t have archive pages for the cam­blog and the side­blog or rather, they were there but weren’t linked any­where. I’ve now made an archives link at the top lead­ing to a monthly overview of the three blogs. I’ve used Kalsey’s Archive Date Header Plu­gin to sort the months by year. I had some trou­ble get­ting a sin­gle page, resid­ing in my blog direc­tory to dis­play links to all of the blogs but finally came up with — what is pretty hack’ish but works — my new archives page: The dif­fer­ent mas­ter archive tem­plates just con­sist of the code to show the links:


<MTArchiveList archive_type="Monthly">
<MTArchiveDateHeader>
<p><b><MTArchiveDate format="%Y"></b></p>
</MTArchiveDateHeader>
<a href="<$MTArchiveLink$>"><MTArchiveDate format="%B"></a> 

</MTArchiveList>

An indi­vid­ual tem­plate then includes these three files using php and dis­plays the cat­e­gories of the main blog. Not very ele­gant but it’ll have to to for now. The links to the monthly pages still include the not-needed-anymore index.php so I still need to get rid of that. And despite not being any good at .htac­cess files, I guess I need to do some magic so links to old archive pages don’t break. On the other hand, the world will prob­a­bly still con­tinue to exist if I don’t.

Oh, and by the way: All pages look like crap. I’m still insist­ing on styling at the very end of this silly project.

Pollas.dk, Web Development. URL.

One Response to Blog redesign, episode 5

  1. Thanks, it was very interesting