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.

Customising the CMS /

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

Page by default not visible in menus


Go to End


3 Posts   2804 Views

Avatar
markus85

Community Member, 12 Posts

18 May 2010 at 8:21am

Hi out there,

I hope you can help me and btw I hope I´m in the right forum :) :

I want a custom page which is a subclass of page to be by default not visible in menu.
There is a checkbox in the CMS called "Show in menus?" be deault this chebox is checked... but I don´t want that.

I think there should be a variable such as

static $is_visible_in_menus = false;

is there such a variable?

best regards

Avatar
Willr

Forum Moderator, 5523 Posts

18 May 2010 at 6:23pm

You can use the $defaults array.

// mysite/code/Page.php

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

Avatar
markus85

Community Member, 12 Posts

19 May 2010 at 5:22am

That´s exatly what I was looking for...

thank you :)