Jump to content
Robin S

Template: Allowed page id(s) for parent

Recommended Posts

Often I want to limit the placement of pages with a particular template to a particular parent page in the tree. Many times this parent page doesn't need to have it's own unique template, but I end up duplicating one of my existing templates (lets say it is "basic-page") just to make sure editors don't have the ability to mess up the placement of pages, and so I can make make use of the "Add New" shortcut.

So I end up with "basic-page" and duplicates "basic-page-2", "basic-page-3", etc (naming is just for argument's sake). When templates are duplicated the problem isn't so much the template files, because it's easy to manually assign the file of basic-page to basic-page-2 and basic-page-3. The problem is maintenance - if I want to add a field to basic-page, change a label or field width override, etc, I now have to repeat these changes on multiple templates. It becomes difficult to keep the duplicated templates in sync.

Having a template setting "Allowed page id(s) for parent" would avoid the need to duplicate templates in this situation. An alternative possibility is some system of template inheritance, but that's another kettle of fish. :)

Share this post


Link to post
Share on other sites

Wow! Thanks for sharing, BitPoet! I suppose it works with 2.7.x and 3.x too, right?

Share this post


Link to post
Share on other sites

Haven't tested it in 3.x yet, but I'm about to.

Update: tested with 3.x and worked like a charm. :)

Edited by BitPoet
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...