I have a block definition like this:
fields:
features:
type: pages
query: site.find('features').children.filterBy('template', 'in', ['feature'])
minor_features:
type: pages
query: site.find('features').children.filterBy('template', 'in', ['feature']).without(this.features)
Is it possible for the second select to only show pages not selected in the first one?
Yes, possible, but not on the fly, i.e. results selected in the first field must be saved first.
this
is not valid in this context. Must be page.features.toPages()
.
Thanks, that’s awesame.
Can I print all titles of the selected pages as the block’s label?
label: "{{ features.pluck('title').join(', ').or('No features selected') }}"
just returns …
The block label does not support full query support. It only allows to to reference fields that return a simple string or number value (such as e.g. text, textarea, number, date, select).