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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Hide a Page from the Site Tree?


Go to End


5 Posts   1868 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 September 2008 at 4:51am

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?

Avatar
Hamish

Community Member, 712 Posts

16 September 2008 at 7:57am

Try adding this your class:

static $can_create = false;

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 September 2008 at 8:00am

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.

Avatar
Hamish

Community Member, 712 Posts

16 September 2008 at 8:05am

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?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 September 2008 at 8:07am

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