Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Making a child, where is not allowed

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

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

Page: 1 2
Go to End
Author Topic: 2820 Views
  • xmedeko
    Avatar
    Community Member
    94 Posts

    Making a child, where is not allowed Link to this post

    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).

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Making a child, where is not allowed Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Making a child, where is not allowed Link to this post

    "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');

  • xmedeko
    Avatar
    Community Member
    94 Posts
  • Andy
    Avatar
    230 Posts

    Re: Making a child, where is not allowed Link to this post

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

  • msantang
    Avatar
    Community Member
    41 Posts

    Re: Making a child, where is not allowed Link to this post

    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.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Making a child, where is not allowed Link to this post

    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

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Making a child, where is not allowed Link to this post

    Just wanna subscribe to this thread.

    I was wondering , is this feature on the roadmap ?

    2820 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.