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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Data Object / Site Tree Settings


Reply

5 Posts   1336 Views

Avatar
J2-Paul

14 October 2010 at 4:46am (Last edited: 14 October 2010 4:50am), Community Member, 51 Posts

I would like a certain page class not show in a menu as the default.

I have tried this in my page class.

static $ShowInMenus = false;

but this does not work.

Had a trawl through the forums and api documentation, but can't seem to find anything.

Is this even possible? If so how? And where is this documented, I am sure there other useful stuff I could learn from the page that gives this information!

Thanks in advance.

Paul

Avatar
swaiba

14 October 2010 at 5:37am Forum Moderator, 1796 Posts

Something like this?

static $defaults = array(
'ShowInMenus' => false
);

Avatar
J2-Paul

14 October 2010 at 5:42am Community Member, 51 Posts

Pefect. That's do then trick. Many thanks!

Can you direct me to where this documented so I can investigate what other items can have their default values modified.

Cheers

Paul

Avatar
swaiba

14 October 2010 at 5:46am Forum Moderator, 1796 Posts

Well I remember it from here... http://doc.silverstripe.org/tutorial:2-extending-a-basic-site#allowing_comments_on_news_articles
but for the documentation... http://api.silverstripe.org/trunk/sapphire/model/DataObject.html#var$defaults

FYI I keep a shortcut to the DataObject, DataObjectSet, SiteTree & FieldSet as these are ones I always use.
Other than that http://api.silverstripe.org/trunk/elementindex.html and then Ctrl+F

Avatar
J2-Paul

14 October 2010 at 6:02am Community Member, 51 Posts

Thanks again. Very helpful.