Separating 'pages' in the panel based on a Select Field value

Hello,
I’m experimenting with Kirby and have a website with a ‘Team’ section. Each team member is a kirby ‘page’. Each team member has a role ‘Executive’ or ‘Support’ which is allocated by a select field. On the panel I am trying to separate the team pages so that I have a column for the Executive Team and another column for the Support Team. After some digging around I came up with:

filter: kirby.select(“Role”, “executive”)
filter: kirby.select(“Role”, “support”)

But this just lists all pages in two columns.

Here’s my current Blueprint code:

columns:
  - width: 3/5
    sections:
      ExecutiveStaff:
        parent: site.find("team")
        template: staff
        filter: kirby.select("Role", "executive")
        label: Executive Staff
        type: pages
        layout: cards
  - width: 2/5
    sections:
      SupportStaff:
        parent: site.find("team")
        template: staff
        filter: kirby.select("Role", "support")
        label: Support Staff
        type: pages

Any help appreciated!

Many thanks

Pages sections don’t have a filter property. You need to use query, see docs: Pages section | Kirby CMS

And there’s also no kirby.select, where did you get them from?

Brilliant, that’s got it!
query: page.childrenAndDrafts.filterBy('Role', 'executive')

  • Where ‘Role’ is the name of my Select field.

I don’t know where I got kirby.select from… I was trawling for over an hour :smiley:

Thnak you!