This was the toughest part of the upgrade. And the most scary. New features to the templates are:
- new archive types — for example category: monthly, entry, entry listing and page
- paginated archives — not sure how useful these are to me, but it’s all good
- consolidated archive templates
- restructured default templates — instead of a long and cluttered file full of code, it’s now a modular system
- widgets — what used to be includes
There are official instructions on how to upgrade 3.3 templates to 4 templates. Mostly it involves editing existing templates to fit the new version.
What SixApart called for the brave of heart only, is to use the default 4 templates in order to take advantage of “all the new features, new archive types, new template tags, new widgets and new template structure.” Why is it so daunting? Because it’s basically a fresh install, rendering all old templates inactive. In practice this means deleting all the old templates and starting from scratch.
My old templates were full of includes and little hacks here and there. I thought about it — will I lose a lot by implementing fresh templates? The answer was no. I know I will end up learning more about the system this way.
deep breath here goes.
the easy part
- retrieve index txt files from the backup
- create a new blog — I’ve talked about the recipe section for years, now is the perfect opportunity
- set preferences
- under design>templates check each template — I found that no configuration was needed and looking at the main index made me appreciate the clean-ness of the modular system
- check out the new archive templates — again no configuration needed, I’m still learning
- click on template modules — look at the building blocks
- configure header to show site name
- edit entry metadata so it shows preferred date format and category
- by far the most editing is in the sidebar but it’s relatively painless using widgets — I added calendar, bloglines list, buttons and an admin section; the search bar I moved down from where it was at the top
- talking about widgets, these are great … pretty intuitive
- no change to system templates
- save and publish (I’m getting used to calling it publish instead of rebuild)
I made a couple of new posts just to see how it all looks, and it was okay.
the hard part
- start with the travel section — fewest posts, and I figured this is the one section I can afford to completely rebuild if necessary
- check preferences
- under Design>templates go first to the index template section, take a deep, cleansing breath and delete all the templates
- with 2 tabs open — one with the current blog and one with the baseline recipes blog — copy the baseline templates one by one and create an identical new one in the target blog
- repeat with all templates — this will take about an hour of intense ⌘-c and ⌘-v
- some of the templates can be just refreshed (menu under more actions) but just to be pedantic, it’s worth double checking each one
- save and publish
- re-edit any parts that need tweaking
So that was it. Took 2 nights working till very late to accomplish. I still need to look at all the archive pages further down the hierarchy and change some of the verbage and positioning. But I consider it 90% done for every section except hidden doors. Talking about hidden doors, the modular system worked very well, I created a new module to hold the disclaimer and use mt-include on the main index to call it. The trick is to change the main index and category archive to show categories rather than entries.