Need to create read only table in panel page which has pre-filled data of certain pages which has certain tag.
So were thinking about creating structure field, but stuck on problem, that as it seems for structure fields there are no possibility to query and pre-fill. Is it so?
Practical example - has building.yml with tags field:
and now in architects.yml I need opposite way - filter out and show data (in structure field?) of building.yml pages where particular architect as tag is added…
You could probably do this via a hook, although I’m not sure if you can update the field if it is disabled in the blueprint. Why do you need to display this information in the Panel?
As client adds new Architect, he wants to see in its panel page which buildings it has created… kind of overview.
(Its part of migration to Kirby and this feature was in previous SQL based admin panel).
It means, that hook should check and update information (which Building pages Architect has) every time when someone opens particular Architect panel page… Which hook would it be?
No, a page.update:after hook would have to run whenever one of the building.yml files is updated (and a new tag added/removed).
The maybe better alternative would be to use an info field that queries the information and displays it as a list/table. Then you wouldn’t need the hook. You could create a page method/page model method that returns such a list.
fields:
buildings:
label: Architects related buildings
type: pages
query: site.index.template("buildings").children
Only problem, that those pages are not visible right away - I need to select filtered pages manually via “+add”… is there solution to select them automatically?