23371 Posts in 18161 Topics by 2865 members
|Go to End|
1 May 2009 at 10:18pm Last edited: 1 May 2009 10:19pm
How can I set the default page type of children pages to inherit the page type of the parent.
4 May 2009 at 9:47am Last edited: 4 May 2009 9:48am
Not sure if I follow what you are asking entirely, but it sounds like $default_parent and $default_child are what you are after.
5 May 2009 at 8:05pm
What I want is if I have a Products page with sub pages i.e.
> Product 1
> Product 2
I want "Product 1" and "Product 2" to inherit the page type of "Products" so that whenever I add in a new product it defaults to the correct page type rather than the "Page" type.
5 May 2009 at 8:29pm
You can include this in any page class and it will restrict the children allowed to whatever is in the array:
static $allowed_children = array('ProductPage');
5 May 2009 at 8:33pm
BBC, did you check the link I gave? The very first example shows how to do exactly what you want, using both mine and howard's suggestions in tandem.
5 May 2009 at 11:05pm
Thanks, I did look at the link but I was confused at first glance. Looking back I now have what I want, it was as you said.. the first part i.e.
static $allowed_children = array("BlogEntry");
static $default_child = "BlogEntry";
|Go to Top|