Options from $site, conf, or Plugin #Kirby3

Hi.

Is it somehow possible to inject panel select options from a central model? I have a set of categories that is used in several select blueprints and I want to keep the options consistent in Kirby 3

Best regards

One way to do this is to use a tag field in the site.yml and then use the query api to on each select to get the tag list from that page. This will keep them all in sync. However, the problem here is if you make a page and give it a category, and then delete that category from the tag field, it won’t update the pages that have been tagged with it already. This will be true of most ways of doing this - if you change the tags and pages already have that tag, then you will have to manually clean up.

https://getkirby.com/docs/guide/blueprints/query-language

If you want a solution that cannot be changed by the user, you can use a route that returns your set of options and query that in your blueprint.

This is so perfect. Great. Works for me! Thanks for the help.