Fieldtype query propertie - Filter by field on page


i have a toggle field on every page and i want to filter by true/false in the pagefield.
I tried it like that, but didn’t figured out the correct way to solve it:

query: site.mainNavigation.isTrue


query: site.mainNavigation.toPages.filterBy('nameOfToggleField', true)
        type: pages
        label: Seiten
        layout: list
        query: site.children.filterBy('mainNavigation', true)

Thats would work for me i think but for some reason the pages collection stys always the same, even if i do smth like that:

query: site.find('dfggfds')

which should return no page i guess (because the name does not exist), the collection still shows every existing page.

You are using a pages section, not a field. A section doesn’t have a query option, therefore this cannot work.

If you want to use a section in combination with a query, you can use the pagesdisplay section plugin:

Note that this doesn’t allow adding new pages.

Ah i see, many thanks!