Hi guys,
I have to modify the template of a huge number of pages in my Revo website. I’ve found Batcher that should do the job, but I really can’t get it work. I install it with package manager, find the ’Batcher’ menu under components and I start it. But no pages are shown and if I hit ’Refresh’ it keeps saying "Loading..." with no results.
Are there any alternatives to bulk-change the template of the pages?
Thank you.
Is there a way to identify which ones need changing (e.g., change all pages with a given template to another template)? If so, a really simple snippet would do it for you.
I’m not sure why Batcher didn’t work for you. I’ve used it to change templates. You might try removing it completely and re-downloading it.
Hi BobRay, thank you for your answer.
I really can’t get Batcher working and I can’t figure out what’s the problem.
Could you give me some advices about this snippet? I definitely can identify which pages I need to change, and they are exactly belonging to the same template. So I need to change all the pages with template n. 34 to template n. 57, for example.
How can I do it?
Thank you.
-
☆ A M B ☆
- 3,141 Posts
1. Get all the objects with a template of ID 34, using:
$objects = $modx->getCollection('modResource',array('template' => 34));
2. Loop through them with a foreach and change the value and save.
foreach ($objects as $object) {
$object->set('template', 57);
$object->save();
}