ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Add parent and child limits to blueprints

Open tognee opened this issue 4 months ago • 0 comments

I'm proposing to add limits to blueprints for parent types and child types. This would add a parent_types and child_types in the blueprint, like hide does. These properties should be null or not present in the blueprint when not enabled and an array of strings when enabled.

For example:

  • A Contact us page that cannot have any other children: child_types: []
  • A Service addendum blueprint that should only be added under a Service blueprint and have no children: parent_types: ['service'] child_types: []
  • A generic folder page that cannot contain other folder pages: parent_types: ['!folder'] child_types: ['!folder']

This should remove the options in the "create new entry" if the blueprint type cannot be added under the root entry, and from the "add child entry" menu if the blueprint doesn't support that kind of parent or if the parent doesn't support that kind of child. This should also limit drag and drop of the entries with these blueprint in the tree view.

The idea for this comes from how Wagtail does it: subpage_types parent_page_types

This would work well with https://github.com/statamic/ideas/issues/1204, having a max_num property as well

tognee avatar Aug 27 '25 09:08 tognee