Looking for a little assistance

This entry was published at least two years ago (originally posted on October 5, 2004). Since that time the information may have become outdated or my beliefs may have changed (in general, assume a more open and liberal current viewpoint). A fuller disclaimer is available.

Okay, I’m hoping someone out there might be able to give me a hand here.

I’m working on moving Eclecticism from TypePad over to my own server. I’ve got 95% of the site framework finished (i.e., the design and the slight tweaking to account for differences between TypePad and MovableType, enabling TypeKey registration, and so on), but I’ve got one little thing that’s causing me issues.

Here, I keep my linklog in the sidebar as a separate weblog, using an SSI command to insert the last fifteen posts of the linklog into my pages. Quick, easy, and very simple to do — and I’m having a bear of a time getting it working on my server.

Here’s what I’m dealing with…

First consideration: I don’t want to break any of the links to the existing pages when the site moves to my server. Because of this, I don’t want to change the extension on my pages to .php or .shtml, so the SSI needs to work within a standard .html page.

Second consideration: My current intent is to take advantage of MT3.1’s dynamic rendering ability, so that only the index pages of the site will be static files on the webserver, all archive pages will be dynamically generated.

Now, one can tell Apache to process every .html page as an .shtml page, but that tends to induce a performance hit as Apache then has to actively look at every single page as it sends it out, rather than just pumping static pages out the pipe and only having to fiddle with dynamic pages. So it’s an option, but one I’ve so far been avoiding.

Apache recommends using the XBitHack to get around this, so that any file sent out that has the ‘executable’ bit set will be treated as an .shtml file, regardless of extension. However, as I want to use MT’s dynamic abilities, there won’t actually be files to set the executable bit (and if I turn off MT’s dynamic rendering, I have no idea if I can tell MT to set the executable bit on the files it generates).

If my pages had a .php extension, I could use a simple PHP include command. However, in order to preserve any and all existing links to my site, I need to keep the .html extention. Now, somewhere in the back of my head I seem to remember reading that there may be some way to include PHP commands within MT templates, now that MT is more PHP friendly (and uses PHP for the dynamic rendering) — if this is true, than it could be an easy solution. However, so far I’ve yet been able to track down any information on whether this is actually the case, or if I was just hallucinating somewhere along the line. So for the moment, I’m going with the assumption that this isn’t an option.

Creating a JavaScript include seemed like it would be an easy solution — have the linklog create an ‘export.js’ file that uses document.write('whatever'); commands, then call the script with JavaScript (using the same basic technique that I use to add things like my Technorati badge, my blogrolls, my Flickr badge, and so on). However, for some reason, that refused to work — nothing ever appeared (and, because of the way JavaScript works, I couldn’t even look at the source for the rendered page to see if it was calling the JavaScript file correctly, as no matter what the browser displays, the source just displays the script call link). I’m not at all sure why this isn’t behaving.

I even poked around at some of the plugins available at the MT Plugins Directory. At first I didn’t think that they would be an option, as they wouldn’t update every time I added something to the linklog, and the list of links on my main page would only update when that page was rebuilt. Some of the multiple blogs plugins looked promising — I even installed MultiBlog, as it includes a way for an update to one weblog to force a rebuild of a different weblog (i.e., adding a link to the linklog would force a rebuild of the Eclecticism blog, keeping the list of links current), but that won’t work either — firstly, it only rebuilds the indexes (so the linklogs on archive pages would only be updated when their particular page rebuilt), and secondly, it doesn’t play nice with MT3’s dynamic rendering (all dynamically rendered pages returned errors — this makes sense to me, though I’ll be buggered if I can actually concisely explain why, so just trust me on that).

So at this point, I’m stuck — every single approach I’ve looked at for getting my linklog working under the new installation has crapped out.

Anybody have some ideas or pointers for me to look into? I’d really appreciate it.