Header and Footer Includes in TypePad

Posted on April 18th, 2007 in Weblogs, Geekier

advanced-templates.jpgAt Bullet Group, we favor the WordPress weblog content management system for most client needs. It has the most features, it has lots of support, and an active community of developers making plugins and themes that we can cuzstomize for client needs.

We still, however like TypePad in a number of instances, usually when a larger organization needs to set up a large set of sites that will fade in/ fade out through time.

One of the issues with TypePad is the way that its Advanced Templates work is that it makes you propagate the same code— for instance, the header and footer that is the same throughout your site— throughout the 5 basic templates (Main, Category, Individual, Database, and Archive). This can lead to a lot of maintenance if you do a site design or just want to change a simple link in your footer.

Luckily, the answer is built right in to TypePad. They allow for the creation of new “modules”, or code pieces, that can be “included” in each template with a simple line of code. The sidebars in the default TypePad templates already use this method, so that all you have to do is change your sidebar and it is changed on every page of your site.

All we have to do is create a “header.inc” and a “footer.inc.” module, put the code rendering each of these pieces in the proper module, call for them properly in each template, and we have a streamlined code base that is easier to maintain.