In the panel: Show articles based on tags

Hello

On my homepage I would like to have three sections:

  1. drafts
  2. everything
  3. everything with a certain tag (in my example it would be the tag “Kunst”)

I tried my variations of this code:

query: page.children.filterBy('Tags', 'Kunst', ',')

but it always shows every article, it doesn’t filter at all. I took my code from Query language | Kirby CMS and reading that documentation I think my basic idea is correct. But still I need some help here…


I found related questions, but those didn’t really help in this case:


Here is my code:

sections:

  content:

    type: fields

    fields:

      heading:

        type: text

        label: Untertitel

  schulleitung:

    headline: Artikel mit dem Tag Kunst

    type: pages

    sortBy: date desc

    info: "Autor: {{page.author}}, Datum: {{page.date.toDate('d.m.Y') }}, Tag: {{page.tags}}"

    query: page.children.filterBy('Tags', 'Kunst', ',')

  drafts:

    headline: noch nicht öffentlich

    type: pages

    status: draft

    templates: blog

    sortBy: date desc

    info: "Autor: {{page.author}}, Datum: {{page.date.toDate('d.m.Y') }}, Tag: {{page.tags}}"

  published:

    headline: öffentlich einsehbar

    type: pages

    status: listed

    templates: blog

    sortBy: date desc

    info: "Autor: {{page.author}}, Datum: {{page.date.toDate('d.m.Y') }}, Tag: {{page.tags}}"

Hey @carsten_kgs, sections cannot be filtered with a query, you can only filter by status and template.

If you need a query, you can use the Pagesdisplay plugin (but it doesn’t allow adding pages from that section, which shouldn’t be a problem, because you can add from the drafts section).