Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Hide a Page from the Site Tree?

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

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

Page: 1
Go to End
Author Topic: 1506 Views
  • UncleCheese
    Avatar
    4085 Posts

    Hide a Page from the Site Tree? Link to this post

    Maybe I'm going down the wrong road, here, but I have a CTF that's used to edit extensions of Page, and i don't want those objects being displayed in the CMS Site Tree. Are there any flags I can put on the object so that they can only be edited through the CTF and not the full CMS interface?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Hide a Page from the Site Tree? Link to this post

    Try adding this your class:

    static $can_create = false;

  • UncleCheese
    Avatar
    4085 Posts

    Re: Hide a Page from the Site Tree? Link to this post

    Okay.. that was my instinct.. but i wasn't sure if that would..

    a) prevent it from being created in the table, as well.. and..
    b) keep objects that have been created with the table from appearing in the site tree.

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Hide a Page from the Site Tree? Link to this post

    a) I'm pretty sure $can_create only applies to the CMS content editor.

    b) What kind of objects are you creating? I assume the CTF only creates new objects of existing types (ie Class), so as long as you've set $can_create = false for those classes, you should be fine.

    Do you mean that you want a flag to hide specific objects of the same type (eg, some pages, but not others) from the site tree?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Hide a Page from the Site Tree? Link to this post

    Well, that would be ideal, yes. But given that $can_create is a static class var, I don't think that will work.

    1506 Views
Page: 1
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.