Display blueprint field based on parent?

Hi, so I have a site set up with top level sections: Photography and Writing. Subpages in either of these sections can use the same template, and I’d like to share blueprints between them as well - single.project.php rather than photo.project.php and writing.project.php. The only part of my blueprint that is unique between the sections would be a checkboxes field, denoting the category (photography projects have different categories than writing projects).

I found this discussion of Blueprint Snippets, but I can’t quite figure out if that’s what I need in this case.

Could anyone point me in the right direction?

Thank you in advance!

Blueprint snippets will not help here, you would still need two separate blueprints, the only advantage is that you would not have to define all fields in all snippets.

A solution for your problem would be to use a custom categories field that fetches the categories depending on parent page. See this post

If you are into code digging and trying out development versions, you can find this feature which got already added to the develop branch of the panel on Github: https://github.com/getkirby/panel/pull/746 (saves you from always creating a custom field for these things) – but as I said, only use it if you feel familiar with it

@texnixe, thanks for the pointer. I hadn’t run across that thread yet. I’m having some trouble implementing it, but it certainly looks like the best solution for what I need, and I’ll be digging into it more.

@distantnative, good to know… I’ll probably just get myself into trouble digging around in the dev versions though! :sweat:

If you use Git, you can easily just check out the development branch and play around with the new feature. Unfortunately, there is no ETA for when this will become part of the master branch, yet.

If you get stuck, don’t hesitate to ask.