getkirby / ideas

This is the backlog of ideas and feature requests from the last two years. Use our new feedback platform to post your new ideas or vote on existing ideas.
https://feedback.getkirby.com
20 stars 0 forks source link

Specify compatible parent templates in Blueprint #592

Open neildaniels opened 4 years ago

neildaniels commented 4 years ago

In a pages section, you can currently specify a set of templates that can be created. This gets a bit tedious sometimes.

For maybe half of my templates, I tend to think about them as being "compatible" with certain parent templates.

I would like to be able to specify compatible parent templates in a Blueprint.

Example: Let's say I have an Event template and a Calendar template. The only time I want to see "Event" as a potential subpage template is if it's part of the "Calendar" template. (In other words: I shouldn't see "Event" under hypothetical "Blog" or "Projects" sections.)

lukasbestle commented 4 years ago

I see why "the other way around" can make more sense semantically. However this would be a performance issue as Kirby would need to read all blueprints each time a page is created to check which blueprints are compatible. If it's just one blueprint that defines which options should be listed, this process is much faster. This is the reason why we currently do it that way.

neildaniels commented 4 years ago

That's a fair point.

But, in the default case (where a parent Blueprint has not specified and children templates), doesn't every Blueprint get read in order to show its "Template Title" in the "New Page" dialog?

Presumably it's also checking for other options, like if it can be created at all?

I wouldn't expect that checking that one more field is missing or contains the parent template to be particularly intensive.

lukasbestle commented 4 years ago

You are right! When we parse all blueprints anyway, we might as well check for such a filter.