Upgrading Your MT3 Templates to Movable Type 4.0
Movable Type 4.0 has introduced tons of new features including a completely re-envisioned templating and archiving system to make blog publishing faster in addition to making site wide design changes easier.
This document will give users an overview of some the enhancements made to Movable Type’s templates and help users update their templates to take advantage of these features.
Here is a list of just some of the new features and enhancements made to Movable Type 4.0’s templates:
- New archive types giving publishers a greater range of the types of archives they can create including a variety of category and author archives.
- Paginated archives allowing publishers to generate more page views, increase ad revenue and speed up publishing.
- Consolidated archive templates preventing designers from needlessly editing multiple templates that are virtually identical - now edits can happen in one template to affect archives site-wide.
- Restructured default blog templates to easily affect the look and feel of their entire site (not just archives) by editing fewer templates.
- New widgets have been added to make blogs more dynamic and richer in content, such as a “Recently Uploaded Photos” widget and more.
Here is a list of the archive types available in Movable Type 4.0:
To reduce the number of templates a designer would need to edit to affect changes to their archives, the Date-Based Archive and Category Archive templates found in Movable Type 3.x, which had about 99% in common with one another, have been merged into a single template named “Entry Listing.”
Here then are the three archive templates that new blogs are populated with in Movable Type 4.0:
- Entry - default template for publishing an entry (previously individual entry archive)
- Entry Listing - default template for all archive lists of entries
- Page - default template for publishing a page (sister to Entry archive template)
Archive templates are mapped to archive types to determine which template publishes which archive type. Archive types are managed at the bottom of each edit template screen.
The archive pagination that is introduced by Movable Type 4.0 has shown to increase build times by at least 20%. So while Movable Type 4.0 may actually be publishing more (in regards to the number of files), publishing time overall is decreased because the size of each file being published is smaller.
Users who have upgraded from an earlier version of Movable Type can take advantage of this enhancement by making a few changes to their existing Movable Type 3.x templates.
The first thing to make the changes necessary to paginate your category archives.
- Navigate to the edit screen for your Date-Based Archive template. At the bottom of the page click the “Create New Archive Mapping” button.
- Select “Category Monthly” (or Daily, Weekly or Yearly)
- Click the “Add” button
Now, let’s reduce the number of entries that get displayed on your Category Archive pages to decrease the time it takes to publish them.
- Edit your Category Archive template.
- Look for the
<MTEntries>tag found in that template and change it to
limit to “auto” limits the output to the number of entries or the number of days of entries specified as the Entry Listing Default in Entry Settings. Specifing a specific number limits the output to that number of entries. The
limit modifier is only available in the context of an archive template.
Now that your category archives do not display the entire contents for that category, you will need to provide links to the category archives. The following code will produce an index of the various months within the current category that have entries available:
<mt:ArchiveList archive_type="Category-Monthly"> <a href="<mt:ArchiveLink />"><mt:ArchiveTitle /> (<mt:ArchiveCount />)</a> </mt:ArchiveList>
Place this code at bottom of your Category Archive template. An advanced option would be to place this code in a conditioned block of code in a sidebar template; find an example of this code in one of the sidebar templates of the MT4 default blog templates.
To take advantage of Movable Type’s Pages feature, you will need to create a page archive template and mapping.
- Create a new archive template called “Page”
- Copy the contents of the “Individual Entry Archive” template in to the new “Page” template
- At the bottom of the template click the “Create New Archive Mapping” button.
- Select “Page” and click “Add”
- Save the template
- Now when you create new pages, they will use this template.
You can optionally use an adapted version of the Individual Archive Template for your pages.
Though it may be time consuming… in order to take advantage of all the new features, new archive types, new template tags, new widgets, new template strucure and more… we highly recommend using the Movable Type 4.0 default blog templates and re-implementing your site’s design.
Implementing your site’s design using the new blog templates will be much simpler than it was with MT3 blog templates due to the restructured templates.