I want to query the parent’s structure field to populate a checkboxes field. The tags solution (Option from other field / source field) in the docs won’t work in my case.
However, in my case I need the ability to assign more than one category to a project (multiple selection). Because of that I tried to get this example to work with a checkboxes field. Can someone push me in the right direction? How do I have to alter the following customcheckboxes.php?
leave the checkboxes field as is and use the query API, for a way to create a json file in /assets, check out this post (btw. the problem mentioned with localhost has been solved in the meantime)
extend the current checkboxes field, I’ll try to look into this, haven’t done it with that field yet
In case of solution 1: How do I fetch the data into a json file and save it in the assets folder? Can you point me to a resource where I can read how to do that?
Is the hook approach in site/config/config.php below properly?
kirby()->hook('panel.page.create', function($page) {
// How to create the json file and
// how to save it in the assets?
});
Thank you for the quick support @texnixe.
Works like a charm. You’re a lifesaver.
One thing though, is there a way to define the path of the json file in the blueprint as a relative one? (So that it don’t have to be redefined every time the page is moved to a new domain ? …)
Hey, I’m now trying to extend the checkbox field as well. I managed to get a fully dynamic select dropdown, but now I need to be able to have a dynamic field to auto populate from another fields structure.
Here is how my structureselect looks currently, I’d like basically the same thing, but I am not sure how to convert that over to extend the checkbox field.