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:
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-99wh4xvyziip0fevag-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:
What you can do, however, is create a custom page method (e.g. getWorkgroups()) that returns a list of titles from the pages collection stored in the field.
Then use this custom method in your column:
columns:
workgroups:
label: AGs
type: html
value: "{{ page.getWorkgroups() }}"
Thank you Sonja! These custom page methods also appeared as term in my searches. I will try that out and give you feedback how that turned out. Already good to know that I don’t need to bother any longer with query language acrobatics.
Landed here looking to solve the same problem. Those double curly bracket queries can be a pain, huh? Anyway, ended up solving it very similarly to @texnixe but thought I’d post a slightly more scalable version: