Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Making a child, where is not allowed


Go to End
Reply

9 Posts   2947 Views

Avatar
xmedeko

28 May 2007 at 5:50pm Community Member, 94 Posts

Hi,

I have a class

class BlogPost extends Page {
...
static $allowed_children = "none";
static $default_parent = "blog";
...
}

I think it should not be possible to make a child of "BlogPost" anyhow, because of $allowed_children = "none". But it is.

In the CMS->SiteContent I click "Create" and choose "Page" from the list of possible new pages. But I do not click "Go" button. Then I choose a page of my BlogPost class. Then I click "Go" button near "create", i.e. in the upper left corner. The new page is created as a child of the "BlogPost". Or at least it is shown as a child of "BlogPost" in the tree in CMS (even after browser reload).

Avatar
Sam

29 May 2007 at 8:11am Administrator, 685 Posts

Sadly, allowed_children doesn't exist. The way the system was built it was hard to add allowed_children.

Avatar
Willr

29 May 2007 at 5:15pm Forum Moderator, 5511 Posts

"Sadly, allowed_children doesn't exist."
I guess we should get Andy to update tutorial 2 then because this is from tutorial 2..

static $allowed_children = array('ArticlePage');

Avatar
xmedeko

29 May 2007 at 7:40pm Community Member, 94 Posts

Someone should update all of these pages

http://doc.silverstripe.com/doku.php?do=search&id=allowed_children

Avatar
Andy

29 May 2007 at 9:16pm 230 Posts

Is there plans to add this later? Otherwise we should probably remove it from the source?

Avatar
msantang

29 May 2007 at 11:48pm (Last edited: 30 May 2007 12:07am), Community Member, 41 Posts

I think this is a Very important Feature.

If you create a Holder page for Products for example, you need only product pages to be children of these holder.

Avatar
Sean

30 May 2007 at 8:58am Forum Moderator, 921 Posts

I agree...

Can we not do a check on creating a new page-type on a current page, that is has the page-type you're trying to create in the static $allowed_children = array() ?

Cheers,
Sean

Avatar
Fuzz10

12 January 2008 at 3:02am Community Member, 787 Posts

Just wanna subscribe to this thread.

I was wondering , is this feature on the roadmap ?

Go to Top