Show field when either field 1 or 2 is selected

Hi,

Is it possible to show a field when field 1 OR field 2 is selected?

Something like overlay: color, gradient see below:

overlayStyle:
  label: Overlay style
  text:
    - Light
    - Dark
  type: toggle
  when:
    type: image
    overlay: color, gradient

No, or conditions are currently not possible.

Ok, thanks anyways! The only reason I asked is because it would reduce the number of fields that share the same user input.

What about within page template PHP? I tried using some OR syntax for an IF the other day and couldn’t seem to get it to work.

Not really, this is just to optimize the yml files, to reduce the number of fields in some scenarios.

Could you describe your problem in more details. Seems to be a completely different issue.

Yes, this is a different issue. I’ll post elsewhere. :wink:

I just posted this as an idea here: https://github.com/getkirby/ideas/issues/467

@johan I closed that issue again because it was a duplicate of an existing entry.

1 Like