Updating your templates for v3.2
This is an archived entry from the Movable Type 3.2 beta test.
Entries from the current beta release (v3.3) can be found here.
In developing new versions of Movable Type, we always strive to maintain backwards-compatibility with templates from previous versions. However, as the application becomes more advanced, so too do the templates. This means that to take advantage of new functionality, it is important to also upgrade your templates.
Movable Type 3.2 introduced a number of features which provide you more control over the way comments and TrackBacks are accepted and how they are treated after submission. Many of these changes require the new template structure to be in effect. In addition, the new templates allow you to see changes you make in your feedback settings after only rebuilding your weblog's index templates, as opposed to all of your individual archives. For those of you using static templates, that's a huge win, despite the new and cool animated rebuilding icon. :-)
Making it easier
To aid you in converting to the new templates we've done two things. First, we made a huge effort to greatly simplify the comment and TrackBack template tag structure which became so complicated upon the debut of TypeKey authentication. In Movable Type 3.2, we've pared back and hidden away much of the necessary Javascipt logic and introduced some powerful template tags that just do the right thing.
Secondly, today we are releasing the Template Refresh plugin. This plugin allows you to get the latest default templates while still preserving (as a backup) your old templates.
How the TemplateRefresh plugin works
The TemplateRefresh plugin allows you to refresh one or more templates to the latest default templates shipped with Movable Type. In doing so, the current template is copied to a backup and labelled as such. In addition, the new template will inherit all settings of the old template and the old template will be disabled.
This allows you to quickly utilize the new templates shipped with Movable Type while still keeping your old ones around so that you can port your changes into the new templates.
Installation of the plugin
Installation is as simple as most other plugins. Download the archive, unpack it and upload the TemplateRefresh directory to your Movable Type plugins directory. The plugin is now in effect.
Refreshing all templates on a weblog
Go to the Weblog listing screen in the System Overview. Select a weblog and choose "Refresh Template(s)" from the action bar dropdown. All of the templates in that weblog that match default templates will be copied to backups and refreshed with the new code and settings.
This is the preferred way to execute the plugin because it is the only way currently to refresh System plugins and will add crucial templates which did NOT exist in previous versions (e.g. the Site Javascript templates).
Refreshing single templates
Go to your weblog's template listing screen and select one or more templates. Choose "Refresh Template(s)" from the action bar dropdown. Assuming you've chosen templates which match one of the default templates by name, your selected templates will be copied as backups and be updated with the default tags, structure and settings.
This method is great for simply getting back to the default template if you've messed up beyond repair.
Customize
After you refresh your templates, you can then take the time to copy over any modifications you've performed in the past, like adding template modules or sidebar elements. I would caution you however against messing with the HTML structure (e.g. divs and class/id attributes) for a reason that we will soon explain. Trust me on this one. You'll love us for it.
Posted on July 24, 2005 11:50 AM in


Comments
That's very helpful of you :) ..next release: MT 3.foolproof
Posted by: demonsurfer
|
July 24, 2005 12:39 PM
..so when comes the MyAss3 plugin ;) (yes, I took screen shots)
Posted by: demonsurfer
|
July 24, 2005 12:42 PM
Ha! Funny. A guy makes a mistake and you never let him forget it, do you... :-)
Posted by: Jay Allen
|
July 24, 2005 12:47 PM
heh, hell no :)
Posted by: demonsurfer
|
July 24, 2005 12:53 PM
Jay,
Feeling bold, and after playing around with beta 1, I decided that I would install beta 1 20050723 on my main site this morning.
What I found out is VERY disturbing. My MT-Blacklist AND SPAMLookup refuse to work any longer. Additionally, the "trusted" commenter feature simply does not work, even after I have gone and "trusted" all of my regular commenters.
Posted by: Political Pulpit
|
July 24, 2005 1:26 PM
Reading through the Beta Blog post about certain known bugs can be very fundamental.
Posted by: Carla
|
July 24, 2005 4:54 PM
Would it be terrible hard to make an extra tab on the templates screen for those backups? Right now it's mighty confusing to look at with backups and live templates mixed in.
Posted by: Sara
|
July 24, 2005 5:41 PM
Political Pulpit, nothing should be "disturbing" in a beta test. We've said very, very clearly that there will be bugs, possibly of the data destroying variety. The whole purpose of this period is to find them and squash them.
So, with that in mind, you should file bugs if you believe you have found some.
FWIW, I'm using beta-2 on my site and SpamLookup is working just fine. I'm not using Blacklist (because SpamLookup does it all for me), but others who are don't seem to be having any problem after applying the hack Carla linked to above.
Posted by: Jay Allen
|
July 24, 2005 5:43 PM
Actually, at this point in the game, yes -- very hard indeed.
Anyway, the transition period during which you have both templates and their backups shouldn't last too long, should it?
Posted by: Jay Allen
|
July 24, 2005 5:50 PM
I can get used to it ;) Just took me a bit by surprise seeing it all there.
Posted by: Sara
|
July 24, 2005 6:04 PM
The template refresh plugin is very good. I notice that the new main template is sans calendar. Is that the plan for the new MT 3.2 template? And if so, will there be an easy way to add it back in afterwards? Again, great plugin!
Posted by: Kevin H. Stecyk
|
July 24, 2005 6:49 PM
The calendar code will be included in the documentation, but we've found that most people remove it straight away because unless you're using daily archives, it only points to the latest entry on that day AND it slows down rebuild times dramatically.
Posted by: Jay Allen
|
July 24, 2005 6:53 PM
I'm updating my template now (since it's pretty custom) and noticed there's an ID in the new template: "layout-two-column-right"
Is that hinting at what I think it's hinting at?
Posted by: dw
|
July 24, 2005 7:53 PM
I noticed that a link to the master archive list in the index template is hardcoded as archive.html
Posted by: Sara
|
July 24, 2005 8:34 PM
You'll have to wait and see. We'll be talking soon, I promise.
Unless I misunderstand what you're talking about, that has been the case since v1.0. It probably should be <$MTLink template="Master Archive Index"$>
Posted by: Jay Allen
|
July 24, 2005 8:41 PM
I have never noticed it being hardcoded as .html, of course it's been so long since I've used just the standard templates (Once I got over the fear of the templates).
Posted by: Sara
|
July 24, 2005 8:54 PM
Actually there are seven hard-coded values. I've filed a bug on this. Thanks Sara.
Posted by: Jay Allen
|
July 24, 2005 9:02 PM
Just a quicky... Is it right that the System Templates can't be refreshed?
If not then I'll log a bug... :)
Posted by: Andy
|
July 25, 2005 12:59 AM
They can, on the System Overview » Weblogs listing.
They cannot on the weblog's template listing. Don't bother filing a bug. We've already got one on it.
Posted by: Jay Allen
|
July 25, 2005 6:27 AM
Under an old template, if I uncheck "Accept Comments," the "Comments" link vanishes... as do any previously published comments for that entry.
I'm still trying to gather information for a bug report and ascertain if it only happens with the old (3.0-3.17) template structure. (I ran MT-Close a few weeks ago and the problem posts are in that group.) But has anyone else seen this?
Posted by: dw
|
July 25, 2005 10:08 AM
I'm guessing it's your template. I'm using a fresh install of the most recent current nightly (3.2b-20050723) and I just tried unchecking accept comments on an existing entry. The comments(x) link is still there on the index page at the bottom of the entry (as expected), and if I go in, it shows all existing comments but there is no comment form to add new comments (as expected).
Posted by: demonsurfer
|
July 25, 2005 11:51 AM
Yeah, it is indeed the old template. When I replaced the old comment tags with the new comment code from the new template, the comments worked correctly.
Workaround is to replace old comment code with new comment code on all the templates (index, archives). I don't like that solution, but it does the job. Other option is to just upgrade to the new templates.
I've filed a bug report.
Posted by: dw
|
July 25, 2005 12:21 PM
I've noticed when I published an entry and notice moments later I made an error in grammar or spelling, when I edit the entry, it is duplicated in my date-based archives, like so. As you can see in my July archives, for each edit I made, a duplicate post was added. I've checked this on a fresh install, and the same thing happens.
Anyone else notice this?
Posted by: Carla
|
July 25, 2005 1:22 PM
I've noticed when I published an entry and notice moments later I made an error in grammar or spelling, when I edit the entry, it is duplicated in my date-based archives, like so. As you can see in my July archives, for each edit I made, a duplicate post was added. I've checked this on a fresh install, and the same thing happens.
Anyone else notice this?
Posted by: Carla
|
July 25, 2005 1:22 PM
hehe.. there's a certain irony in that double posting :)
Posted by: demonsurfer
|
July 25, 2005 1:27 PM
hahaha, I didn't catch that. smile
Posted by: Carla
|
July 25, 2005 1:29 PM
I just noticed the same problem with duplicate postings in my (dynamic) category and monthly archives. Every time I re-save an entry it adds it again to those archives. Happens both with my upgraded blogs and a newly created (with MT32b2) blog.
Posted by: kate
|
July 25, 2005 2:09 PM
Hi kate. I responded to your comment in the User-to-user support thread. We're trying to keep support discussion in that one thread and I'd appreciate it if you could help us do that. Thanks.
Posted by: Jay Allen
|
July 25, 2005 2:52 PM
Following installation of the plugin, I'm now getting this:
Build error in template 'Atom Index': Error in tag: Error in tag: Could not create atom id for entry 1123
Thoughts?
Posted by: Paul
|
July 25, 2005 10:41 PM
One word of warning ;) - make backups of your templates manually before running it! At least in my case - a heavily customized one - it did a reset of the templates without making backups himself :(
Posted by: Lutz-R. Frank
|
July 25, 2005 10:44 PM
That was fixed in MT3.2b-20050723
Posted by: Jay Allen
|
July 25, 2005 10:45 PM
I must say that I'm liking the modifications to 3.2. The Remember Me module really simplifies my templates. Thanks!
There is one thing I'm wondering if it could be inserted at some stage: the ability to filter for posts that have no category. If you've imported a lot of posts and they don't get categorized properly, it can be a little hard to select those that don't have a category. The filter only allows you to select for a particular category.
Posted by: James Bow
|
July 26, 2005 11:04 AM
There are actually a few places where this would be really useful and cannot be done. We have a feature request in our tracking system on this functionality. I don't know if we'll get to it in this release considering the work we still have to do to fix bugs, but if we can, we will.
Thanks James.
Posted by: Jay Allen
|
July 26, 2005 11:14 AM
I take it this means the database settings of the template, not the actual contents of the template itself. It appears that the new default templates do things like replace my style sheet which seems unnecessary.
I'm sure that this plugin is great for many users, but if you have customized your templates to any degree, no so.
For my purposes, it would be more useful to have a set of context diffs between the old versions of the default templates and the current versions. In the best of all possible worlds I would be able to use these to automatically patch my heavily modified versions of the templates. In this world, I'll settle for patching them by hand.
I'll do this myself with the 3.17 templates. I see they are here listed separately in textboxes here: http://www.sixapart.com/movabletype/default_templates so getting them is a chore. I see you are including the templates with the 3.2b2. I'll be saving these for future reference.
Posted by: Ray Baxter
|
July 30, 2005 12:30 AM