Template Modules Good!

Not only is David Gagne’s Blogdata tutorial (explaining how to do a set of icons at the bottom of each post for links to categories, comments, mail this post, etc.) a cool trick that I’m going to have to steal, it also finally made the Movable Type template modules idea click for me.

It’s really a pretty simple idea, just put any code that’s going to appear in more than one template in a separate template module, and then include it with <$MTInclude module=”name”$>, but once you get used to it, it’s a very cool thing. My first use for it is a “doctype” module, while I fight with Mozilla over whether or not a <hr> in an XHTML document should jump outside its parent and run clear across the entire body. I know, a doctype isn’t really something that you should be changing so often that you need it to be in an include, but I’m fickle like that. Then when I get done fighting with that, the whole sidebar is going into a template module or two, along with the popup comment code. I just hope it doesn’t include recursively: if you can put an include in an include, I’m sunk. Just like too much of my coding, I’ll end up with two hundred one line modules.


No comments yet.

Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.