exclude page type from anywhere

Vote:
 

I have a page type of NotesPage that is only to be used internally for our client to read notes about their site to make editing easier. I have added the page. However, I want to not allow them to accidently add another page with that type and make it live. 

I've tried putting this on my BasePage.cs...

[AvailableContentTypes(Exclude = new[] { typeof(NotesPage) })]



But I can still create a page from the new page function in the CMS top tool bar plus sign. Is there a way to not be able to create a page from this type from anywhere in the CMS?

#132984
Aug 21, 2015 18:25
Vote:
 

Hello Nathan

If you only ever want one instance of the page then you can set this up through security: Admin mode > Content type > [Your NotesPage type] >Settings > Access Level. Its also possible to set this up in code if required.

By removing all access it will ensure no-one else can ever create an instance of that page.

David

#132985
Aug 21, 2015 18:59
Vote:
 

Thank you so much, David! Worked perfectly.

#132987
Aug 21, 2015 19:03
Vote:
 

Glad it worked :)!

Its also worth mentioing that you can also set this up in code as described in the "Access" section: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/7/Content/Pages-and-Blocks/Attributes/#Access

#132988
Aug 21, 2015 19:05
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.