Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Custom AvailablePageTypes

Vote:
 

I have a set of page types where:

PageA can create children of type PageA, PageB and PageC

PageB can create children of type PageA and PageC

PageC can create children of type PageA.

The thing I want is that PageB and PageC can only be created once and PageC can never be created before PageB.

PageA can be created as many times as the editor wants.

With the settings I have now, I can create:

PageA-->PageC-->PageA-->PageB.

So how can I accomplish that?! I don't want to check the ancestors in any events.

Is there a way to create a custom AvailablePageTypes? 

#142107
Nov 30, 2015 23:03
Vote:
 

Hi,

I think that you cannot use AvailablePageTypes in your scenario.

You could try use IValidate interface, to validate the structure during saving the page.

You could also subscribe to PagePublishing/PageSavingEvent and check if the structure is correct. If not, then reject changinges using e.CancelAction and e.CancelReason event parameters.

#142112
Dec 01, 2015 7:43
Vote:
 

I did a thing to limit page types to be create only once.

http://world.episerver.com/blogs/per-nergard/dates/2014/6/limit-block-and-page-types-to-be-created-only-once/

Maybe it could be of use..

#142125
Dec 01, 2015 14:30
Vote:
 

Hi and thanks for your answers.

I think I will go for the event solution.
Per --> Cool feature, I will look into to it :)

Pitty though that you can't customize AvailablePageTypes attribute..

#142140
Dec 02, 2015 10:02
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.