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

setting defaults for page types


Go to End


2 Posts   1439 Views

Avatar
Nicolaas

Forum Moderator, 224 Posts

7 February 2008 at 2:54pm

Edited: 07/02/2008 2:56pm

Hi Gurus

Is there a way to set a default "behaviour" or "access" setting for a page type? For example, for "members-only" pages, if the CMS admin creates a new "members-only" page, the access is automatically set to "logged-in users" only.

Any ideas appreciated.

Nicolaas

Avatar
dio5

Community Member, 501 Posts

9 February 2008 at 11:36am

I know there's a defaults array you can set for every page type.

So maybe you could try something like:

static $defaults = array( "Viewers" => "Anyone" ); (Or "LoggedInUsers" or "OnlyTheseUsers")

but I'm not sure if that's what you're looking for.