2024-12-22

Upgrading to Movable Type 4: The Saga II

Movable Types

The template module system is much more refined in MT4 compared to MT3.x, but the navigation in the Dashboard is a little bit cumbersome. The navigation in MT4.2 is much better, (phew!). There is also a dashboard plugin called Template Shelf that might be useful. I tried it in MT4.1 and it made it much easier to jump between various modules and templates. I’m not sure it is compatible with MT4.2, and its benefit may only be incremental over the new navigation layout.

The templates and modules were very complex in MT4.1. I liked the modularity of the pieces, but I hated the fact that certain modules contained opening elements (like <div> and <html>) and others contained the closing elements! This means that redesigning a page can be extremely tricky. In MT4.2 the default templates have been greatly simplified and most of these “paired” modules have been removed. After futzing around with the templates I came upon a neat little way to make very simple pages that can be used for just about anything (indexes, archives, Pages, etc). I’ve called it the “Page Shell” which creates all of the layout in a consistent way, and inserts the actual content by means of a PageContent variable.
A stripped down version of page shell looks like this:

    
    
      <$MTInclude module="Header"$>
      
        
<$MTInclude module="Banner"$> <$MTInclude module="Navigation"$>
<$MTInclude module="Footer"$>

That’s it! Nothing else. And I can use it for any page I like. For example to generate the main index, the template looks like this:

    
    
    
    
    
    
    
      
        <$MTEntryTrackbackData$>
        <$MTInclude module="Entry Summary"$>
      
    
    <$MTInclude module="Page Shell"$>

The “guts” of the page are completely in PageContents block! Other pages are variations on this–the multi-conditional logic from the MT4.1 archives pages was dropped straight into the PageContents section. This greatly simplifies page generation, because I can futz with the “Page Shell” layout and the style file and all of my pages will be updated appropriately.