Hey there!
I just got my feet wet with Kirby 4 and I’m very pleased by the amount of things that are possible with it. Great work!
I have a question regarding table layout columns, the solution of which I couldn’t research or puzzle together from other people’s questions and code snippets. The table prints out one row per page. Each page’s template has a checkboxes field configured who’s options consists of pages of another type - in order to build a relation between the two:
workgroups:
label: AG(s)
type: checkboxes
options:
type: query
query: site.children.template("workgroup")
A field entry in a page would appear like this:
----
Workgroups: ag-page-99wh4xvyziip0fev, ag-page-mcinhkzc65fwccwe
----
Now, what I would love to have is a column in my layout table, which instead of showing me the slug of the selected pages (e.g. ag-page-99wh4xvyziip0fev
ag-page-mcinhkzc65fwccwe
) would instead show me their human readable titles. But I can’t figure out if and how that might be possible via query syntax. This is what I’m fiddling around with right now:
sections:
pupils:
type: pages
layout: table
columns:
workgroups:
label: AGs
value: "{{ page.workgroups }}"
I fiddled with .pluck()
and toPages()
and whatever else in my value query, but things never changed for the better. I probably didn’t really get them.
Thanks in advance for your help!
Schepp