Is there a way to limit "page levels"?

What do I mean by “page level”?
A first level page is child to $site.
A second level page is child to a first level page.
etc…

Is there a way to limit the number of levels a user can create through the panel?

The only way I can think of is having many, essentially identical, blueprints that limit the type of child blueprints like this:

site.yml:

pages:
  template: firstlevel
fields: ...

firstlevel.yml:

pages:
  template: secondlevel
fields: ...

secondlevel.yml:

pages:
  template: thirdlevel
fields: ...

thirdlevel.yml:

pages: false
fields: ...

As you can imagine this becomes rather soon a maintenance problem. Just think what this means if I want also to have many different templates, I would have to maintain three times the “normal” number of blueprints.

Is there any other way? Ideally something like:
site.yml:

pages:
  maxlevels: 3
fields: ...

There is no such general setting and usually, the type of template determines if a page can have children or not.

With Kirby 2.4.0, you will have permissions based on roles which would also allow you to limit page creation depending on page depth.

2 Likes

Didn’t think about the new permissions API like this.
Thanks! I’ll definitely try that.

Stuff like this is what makes me so keen for Kirby 2.4. So much more is now possible, even beyond what you’d initially think to use it for. Truly “Flexible as hell” :stuck_out_tongue: You guys are doing amazing work!

1 Like