Using the current if_any construct, it's impossible to match on multiple options of a select field. For example:
-
handle: type
field:
type: select
options:
opt1: Type 1
opt2: Type 2
opt3: Type 3
-
handle: some_detail
field:
type: toggle
if_any:
type: opt1
type: opt2
The blueprint above is invalid because of the duplicate type key inside the if_any. Thus, it's impossible (using if_any) to make the some_detail field show up when "Type 1" or "Type 2" are selected, but have it hidden when "Type 3" is selected.
As a workaround, using a custom method works:
Statamic.condition('type1OrType2', values => ['opt1', 'opt2'].includes(values.type));
-
handle: type
field:
type: select
options:
opt1: Type 1
opt2: Type 2
opt3: Type 3
-
handle: some_detail
field:
type: toggle
if: type1OrType2
Using the current
if_anyconstruct, it's impossible to match on multiple options of a select field. For example:- handle: type field: type: select options: opt1: Type 1 opt2: Type 2 opt3: Type 3 - handle: some_detail field: type: toggle if_any: type: opt1 type: opt2The blueprint above is invalid because of the duplicate
typekey inside theif_any. Thus, it's impossible (usingif_any) to make thesome_detailfield show up when "Type 1" or "Type 2" are selected, but have it hidden when "Type 3" is selected.As a workaround, using a custom method works:
- handle: type field: type: select options: opt1: Type 1 opt2: Type 2 opt3: Type 3 - handle: some_detail field: type: toggle if: type1OrType2