Force a page type to always be a child page of a chosen parent

Permalink 1 user found helpful
Hi,

I am wanting to make it so when an editor of a site adds a certain page type (which I have defined) the new page they add will always be the child of a designated parent (forced child), no matter where the page is added from when they're browsing / editing the site. Is this possible?

Maybe someone could help me write a little bit of code for it

Something like: function on_page_add($page) ... check page type, if it's x page type then move that page so it's a child of page I've setup ... Sounds simple enough in theory, would anyone know the code for this? Wish I knew how to write PHP :(

Help appreciated! Thanks in advance.

 
frz replied on at Permalink Reply
frz
That's gonna take some hacking at the core, which we'd advise against. Some other options:

1) Limit the page types individuals/groups can add from a page by using advanced permissions. You'll see a drop down at the top of the advanced permissions window that lets you switch to Sub Page Permissions. That controls who can add what. (solves the limit page type but not the only post to one spot thing)

2) Build a composer template for this page type and train your client to use Composer to make these pages. You CAN limit composer to ALWAYS place pages of a new type (say Blog Post) under a specific page (in this case the Blog)
nomaknz replied on at Permalink Reply
Thanks for your reply. I have done exactly that and then used an addon called Force Single Sublevel, so now they can only add sub pages to the parent I'm allowing them to and any pages created under this are forced to the single sub level (so childs can't be parents etc). Works well.

For those interested in the addon:http://www.concrete5.org/marketplace/addons/force-single-sublevel/...