Blueprint: query with toggle value for panel filter

I have following blueprint and for the isfeature field i would like to do a query filter.

  - width: 1/3
    sections:
      category:
        type: fields
        fields:
          isfeature:
            label: Featured
            type: toggle
            text: Show on homepage? 

On my articles overview page I tried to do a filtered section:

  featured:
    extends: sections/articles
    status: listed
    query: page.isfeature

Any hint or help appreciated for the part query: page.isfeature to proceed.

Pages sections don’t have a query option. The only way to filter a pages section would be via a page model that redefines the children() method.

okay thanks - that might be the cause, that I did nowhere find a hint in the great kirby docs ;o)

I made a visual compromise for the overview:

status: listed
info: "🌐 {{ page.isfeature  }} {{ page.date.toDate('d.m.Y') }}"

A conditional output on boolean values would be great feature. Or accessing the fields options for using they labels or states as informational output.

Filtering for sections was originally planned but as I stated in the linked topic, they were stalled because of issues that have to be sorted before having such a feature.

Not quite sure what you mean? Get the information from the blueprint? That is possible.

I can extract the values of e.g.: text: Shown on homepage: into an info output, really?

Yes ,really, like this

info:
  text:  "{{page.blueprint.field('is_feature').text}}"  

will output: “Show on homepage”

1 Like