How to propogate template from parent page to child

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
drew
Forum Members
Forum Members
Posts: 72
Joined: Wed Jan 02, 2008 5:37 pm

How to propogate template from parent page to child

Post by drew »

Hi everyone,

Other than 'manually' applying a template to each page, is there some other way to force all 'existing' child pages to inherit the template used by parent page?

Just thought someone might have an easy solution. Search results turned up nothing.

Thanks for your help, Drew
TQ_designs
New Member
New Member
Posts: 5
Joined: Sun May 18, 2008 2:31 am

Re: How to propogate template from parent page to child

Post by TQ_designs »

I searched for information on this topic as well, but your unanswered post was the only one mentioning it :(

If there isn't a way to do this in the current version, will it be added in v2.0?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How to propogate template from parent page to child

Post by Dr.CSS »

You can go to Layout » Templates and click default at one of the templates you want all new pages to use or click the 'Set All Pages' link which will make all pages have the same template...
TQ_designs
New Member
New Member
Posts: 5
Joined: Sun May 18, 2008 2:31 am

Re: How to propogate template from parent page to child

Post by TQ_designs »

If you want to change the template for every page in your site, that would be a perfect solution...but what I'm thinking of is a situation where you need different templates for certain sections. In this case, what would be ideal is some kind of checkbox that says "Apply parent template to all children".

Perhaps it's already on the roadmap for v2.0 :)
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: How to propogate template from parent page to child

Post by Nullig »

When you're creating the page, you can just select the appropriate template from the dropdown.

Nullig
TQ_designs
New Member
New Member
Posts: 5
Joined: Sun May 18, 2008 2:31 am

Re: How to propogate template from parent page to child

Post by TQ_designs »

True, but I was speaking of a case where you have an existing hierachy (e.g. parent with 10 child pages) and want to change the template for all of them at once (instead of having to change it manually for each child, which could be time-consuming and result in one accidentally being missed).
alby

Re: How to propogate template from parent page to child

Post by alby »

TQ_designs wrote: True, but I was speaking of a case where you have an existing hierachy (e.g. parent with 10 child pages) and want to change the template for all of them at once (instead of having to change it manually for each child, which could be time-consuming and result in one accidentally being missed).
No automatic tool.
You can update with SQL query (no recursive hierarchy):
UPDATE [db_prefix]content SET template_id =X WHERE parent_id = Y

Alby
Last edited by alby on Sun May 18, 2008 5:31 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”