1. previous post: Palestinian Refugees Produce Anonymous File Sharing Service
  2. next post: It’s a Blog, It’s a Recipe Book, It’s a Lyrics Collection…

Modularizing Movable Type Templates Using Template Modules

Filed under “What's New,” “Blogging,” and “Web Design & Development
by Adam at 4:20 PM on August 29, 2003

5 Comments

Well, I’m on my fourth cup of coffee for the day — that really vile generic instant stuff that I’ve kept in my desk drawer since the rest of the office kicked the habit — and I still feel like my brain’s been squished in a press. Even in college I was never good at staying up late for days on end, but this blog has spurred me into a chain of late-night tweaking sessions to get everything just so. But we don’t use the word “addict” on this blog. No, I can quit anytime I want.

So what was I up late doing last night? What could possibly be worth sacrificing my mental and physical well being this way? Modularizing my Movable Type templates, of course! Okay, maybe I do have a problem…

Nevertheless, the power Movable Type gives you to make template editing easy is truly wonderful. I’m sure I’ll make up for the lost sleep and caffeine-fried brain cells later with all the time I save making changes to this site. By breaking out sections of my templates that repeat in multiple places — say a navigation bar, search form, or licensing info — and putting that code into separate files, I’ll only have to edit something once for it to change everywhere.

This may sound familiar to those who’ve used SSI for the same purpose, but Movable Type makes it even easier with Template Modules and the tagiends, search, licensing, and subscription boxes that show up in the sidebars of these pages are now all included in template modules for my future tweaking convenience. I’ve further modularized the sidebars themselves, the related entries code that appears in the individual archive template, and the post information that appears in small gray text somewhere in every post.

To learn more about template modules and how to use them, check out this post at Warmbrain, a site that I promise is more appealing than it sounds.

Adam is a web developer and graphic designer who lives and works in south-central Kansas. He likes to speak his mind, both here and in his business blog. He only rarely writes about himself in the third person, honest. If you’d like to work with Adam, drop him a line.

5 Comments

  1. It’s worth noting that you *can* have too much of a good thing when it comes to template modules. MTInclude makes rebuilds slower, and I’m currently in the process of “de-modularizing” my templates to a degree so that rebuilds won’t be quite so sluggish (e.g. 17 seconds for a comment to process).

    What may be kicking my but the most on the rebuild front is my use of nested MTIncludes. That is, I would include the left column in the individual archive template *and* use further includes within the included left column. I’m eager to see if removing the nesting dramatically improves rebuild speeds.

    Comment by Adam — May 9, 2004 @ 12:51 am

  2. Only about 10 seconds worth of improvement on a full-site rebuild, making it a mind-numbing 2:25 for the whole thing.

    Only 1 sec faster on comment postings. I’ve also noticed that comment wait time is now 17 sec. thanks to all the conditional crap that TypeKey has added on to the individual archive template. That template probably has 3 or 4 times the amount of logic to process during every rebuild now.

    I’m going to give MT-FastInclude (removed after the 3.0 upgrade) another try. It speeds up the rebuild process somewhat through caching. You can get it at http://www.nonplus.net/software/mt/MTFastInclude.htm

    Comment by Adam — May 9, 2004 @ 1:31 am

  3. Full site rebuild time is down another 10 seconds to 2:15 with FastInclude. That’s not as much of an improvement as the plugin was giving me under MT 2.64. Individual entry rebuilds are not affected at all by the plugin, so comment times are still slow.

    I am getting soooo sick of this. :(

    Comment by Adam — May 9, 2004 @ 1:56 am

  4. I could probably afford the controversial new personal license for MT3. However, when I consider what I’d be getting for my money versus what’s available with other free alternatives out there it’s just not worth it. I’ll be testing some other systems and making a switch in the near future. More to come.

    Comment by Adam — May 16, 2004 @ 3:57 pm

  5. Update: I have moved to WordPress. Everything is instant, and all is well. :-D

    Comment by Adam M. — June 2, 2004 @ 10:28 pm

Sorry, comments have been closed for this entry.