Template migration

Posted on 17-Jan-06 at 9:53 pm by Zaigham Rana

Hiya all

I am here with a little tip on quick bulk migration of templates in MODx. (Also asked by Wendy here).

Say you have 1,000 documents or more, and have multiple templates, and you are considering a re-design of a whole website! OUCH! Its a pain to change 1,000 documents' templates via traditional editing facility.

Don't worry, MODx provides you a very easy way to do this tedious job in very short time. To find out how, read the tutorial below:

Case1: You have 1 template for all 1,000 documents.

Solution:

1. Go to Administration -> System Configuration, scroll down, and you will see "Default Template" and a drop down list containing all of the templates along with 2 radio buttons having the labels:

  • Reset all pages to use Default template
  • Reset only 'Default Template' pages

2. Select the "New Template", and select either one of 2 options, hit the save button and refresh the site, and you’re done! (I assume that your new template's name is "New Template")

Case2: You have multiple templates.

Solution:

1. Goto Administration -> System Configuration, scroll down, you will see "Default Template" and a drop down list containing template list along with 2 radio buttons having the labels:

  • Reset all pages to use Default template
  • Reset only 'Default Template' pages

2. Select the name of template, previously assigned to some documents (which you want to change into a new one), and hit save. (Caution: DO NOT select any of the options below.)

3. After the page reloads, repeat step 1 again, and this time you will see the options like this:

  • Reset all pages to use Default template
  • Reset only 'old template' pages

(I assume that your template title is "old template")

4. Now select the "New Template" (the one you newly designed and going to replace "old template" with) from the list, and choose the second option:

Reset only 'old template' pages

(I assume that your template title is "old template")

Hit the save button and refresh the site, and you’re done!

You can repeat these steps for any remaining template migrations.

"MODx really blows me away." , Ryan Thrash.

Its true!

anyways, until next time... take good care of yourself and the people around you.

Meta: RSS feed Permalink

Comments:

1
Thanks for reminding everyone! by Mark 17-Jan-06 10:02 PM
Thanks for reminding everyone of this great feature!
2
Indeed by rthrash 18-Jan-06 12:22 AM
I used this extensively when switching over the MODx templates... great stuff Zi!
3
Awesome indeed!!! by wendy 18-Jan-06 01:20 PM
This is a really2 cool stuff. Great tips for everyone out there who has been using MODx for quite some times. I can't be more agree to the flexibility of MODx. I think even the core developers of MODx itself sometimes got amazed by the flexibility of their own code, because all the things can be achieved with combination of flexible things built inside MODx. I always found myself stupid sometime, when in other CMS system you need to hack something to get things work, in MODx, you can use all the available tools to make the same kind of hack with the other CMS.

Thanks Zi for the great tips.
4
Can only agree with wendy :) by davidm 23-Jan-06 05:08 PM
As I am just finishing my first two websites built with MODx, I can concur with Wendy : it's been amazing working with MODx, and I might have a few tips to share myself :D

You must be logged into the forums to comment. Please login