I have a blueprint where I want to separate pages based upon a toggle. These are virtual pages based on the Content from Spreadsheet guide.
In the blueprint I query the pages with
current:
headline: Current Products
type: pages
layout: list
query: page.children.filterBy("depreciated", true)
search: true
And I just get all the pages returned to the pages field.
In the template I make the same query and it returns the expected results
<?= dump($page->children()->filterBy("depreciated", true), false)?>
Am I missing something?
Is current a pages field or a pages section? A section doesn’t have a query option. If in doubt, please post the context of your blueprint.
This is the context of the blueprint.
title: Product List
icon: document
pages: true
columns:
left:
width: 1/3
sections:
default: fields/default_fields
middle:
width: 1/3
sections:
current:
headline: Current Products
type: pages
layout: list
query: page.children.filterBy("depreciated", false)
search: true
right:
width: 1/3
sections:
depeciated:
headline: Depeciated Products
type: pages
layout: list
query: page.children.filterBy("depreciated", true)
search: true
drafts:
headline: Drafts
type: pages
status: draft
As I suspected, you are using a section which is not filterable via a query. Alternative:
Or if you want to select pages, use a pages field instead
Perfect solution. Thanks for the answer.