adrianmak Posted April 1, 2015 Share Posted April 1, 2015 I only allow user to create pages up to level 2. User is not allowed to create child pages of level 2 Home +----Level 1 +----Level 2 +----Level 2 +----Level 1 +----Level 2 +----Level 2 +----Level 1 +----Level 2 +----Level 2 Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 1, 2015 Share Posted April 1, 2015 1. Make a module like this: https://processwire-recipes.com/recipes/extending-page-save-process/ 2. Use this to move pages: $level_nesting = count($page->parents); if($level_nesting > 1 && $level_nesting > $deepest_nesting){ // $deepest_nesting should be 2 in your case // Move the page one level higher // -2 because of eq counting from 0 and moving one level up $page->parent = $page->parents->eq($level_nesting - 2); } 3. Make this aware of users / roles or whatever you need. 4. (opt.) Leave a notice for the user about what has been done. Edit: small improvement by adding "$level_nesting > 1" Edit 2: Use only the family settings for templates as long as you don't need nesting of the same template. 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now