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   1431 Views

Avatar
J2-Paul

Community Member, 51 Posts

14 October 2010 at 4:46am

Edited: 14/10/2010 4:50am

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

Forum Moderator, 1805 Posts

14 October 2010 at 5:37am

Something like this?

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

Avatar
J2-Paul

Community Member, 51 Posts

14 October 2010 at 5:42am

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

Forum Moderator, 1805 Posts

14 October 2010 at 5:46am

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

Community Member, 51 Posts

14 October 2010 at 6:02am

Thanks again. Very helpful.