Allow 'No available page types'

Vote:
 
Sometimes we would like to make a pagetype a 'leaf', ie an instnace of this page type can have no children. It isn't possible to specify this at the moment, because no selected page types is equivalent to 'all'. This would obviously affect the 'create' functionality as well as the 'Available Page Types' tab.
#18821
Aug 03, 2006 13:08
Vote:
 
I think this would be a great idea too! I even once tried to stop pages from being created below some page-types by hooking events but realized it cannot be stopped without spitting out an exception :(
#19052
Jul 16, 2007 15:07
Vote:
 
I have put in a reuqest for this twice since EPi 4.11 but it seems to end up un-implemented. My solution has been to create a kind of dummy page type that is not available in edit mode and make that the only allowed page type where I want to stop the users from creating new pages. Not extreeeemly pretty, but works.
#19053
Dec 05, 2007 9:15
Vote:
 
Found my old request for this that EPi put on the shortlist, in 2004: http://www.episerver.com/en/EPiServer_Knowledge_Center/Developer-Forum2/EPiServer-Developer-Forums-/2366/2420/
#19054
Dec 05, 2007 9:25
Vote:
 

Although I agree that it would be a good feature it is possible to implement this rather easily.

You could subscribe to the CreatingPage event and check what page type name (or id) is used and abort the creation of the new page and supply a message to the editor in order to inform him/her of why creation was cancelled.

To limit which page types would be affected, you could either create a list of childless page types, or add a pre- or suffix to the page type name which would give you something to look for before aborting creation. I'd use the latter option as all control over page types could still be handled from the page types tab in admin mode.

I'd also suggest that you create a dummy page type as the only option for child pages as that would tell the editor that no children will be created, given that the dummy page type has a informative name.

Perhaps it would be possible to abort even sooner, say when trying to load the edit interface for the dummy page type. I'm not sure exactly how to to that or if it is possible. I'll have a quick look at it tomorrow.

edit:

As it turns out, this is possible to achive with EPiServer CMS 5. If you create a dummy page type and choose it not to be available in edit mode, you can then select the dummy as the only possible page type under the childless page type to disable the editors from creating children to the given page type.

If you'd like to build this functionality for EPiServer CMS 4.x, it would be easiest to subscribe to the LoadingDefaultPageData event and take it from there.

#20054
Edited, May 19, 2008 23:40
Vote:
 

Hi,

 I did short POC on that and managed to do it in quite simple way by modyfing NewPage.aspx (from edit folder). You can read how I did it here:  http://blog.juszczyk.biz/2008/06/how-to-make-page-type-leaf.html

Regards,

Dominik

#20651
Jun 09, 2008 9:05
Vote:
 

You could also look at a the plugin in CodeResort:

 

https://www.coderesort.com/p/epicode/wiki/EPiCodeNewPage

#22447
Aug 05, 2008 14:42
Vote:
 

I have just come across this peculiar EPiServer idiosyncrasy. Quite why deselecting all of the check boxes is equivalent to selecting all of them i have no idea!

Does anyone know why this hasn't been changed over the last 5 years?

#54788
Nov 02, 2011 18:03
Vote:
 

We know about this feature request perhaps it might even be included in the next release.

#54790
Nov 03, 2011 7:57
Vote:
 

Any ideas if this will be fixed sometime soon? It's still not fixed in the latest version CMS 6 R2.

Regards

#60329
Aug 06, 2012 11:06
Vote:
 

I'm pretty sure the ability to restrict any page type is available in the current "EPiServer 7 preview" release so it's possible to use this as soon as we get the release version out.

#60414
Aug 07, 2012 21:58
Vote:
 

Can confirm this has been solved (tested in 9.12).

If the selected pagetype has no available pagetypes defined, you'll get the following behaviour:

1. There will be no "New page" in the page's context menu in the page tree

2. If you click the + icon (new page) in the global tool menu, a page selector dialog will appear, asking where you'd like to create the page.

a) If you select the current page (that has no available pagetypes), there will be nothing listed in the "suggested page types" list, so creating a page is impossible.

b) If you select another node in the page tree that allows any pagetypes, creating a page procedes as normal.

#173421
Edited, Dec 23, 2016 12:18
This thread is locked and should be used for reference only.
* 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.