For a menu builder I want to restrict the choices of the sub pages, to the children of the first level pages chosen in the same structured item.
mainmenu:
label: Menu
type: structure
fields:
firstlevelpage:
label: First level
type: pages
max: 1
subpagesselector:
label: Second level pages… children of the first level
type: pages
query: ???
No, KQL is for querying data from your Kirby installation via API.
Here, you want one field inside a structure to listen to changes in another field inside the structure and then filter the list of options for this second field.
So in my opinion, you probably need a custom field consisting of two subfields, where one subfield listens to the other and then makes a query to the backend to get a list of results. Or maybe a single field is enough, no sure.