Ideas for improving the "when" property used by conditional fields

Hello everyone,
I am working on my content forms and need to create conditional fields.
As I could see here, Using fields | Kirby CMS I can use when and test the value of another field.
Pretty cool.
But in my case I have a field 1 with the options a, b, c, d …
Another field 2 should appear only if the value of field 1 is not a.
I noticed that you can combine multiple conditions (which seem to combine with the AND operator), so I tried:

when:
    field1: b
    field1: c
    field1: d

It doesn’t work because my logic is based on the OR operator.
I also tried the negation:

when: 
    field1: !a

commas:

when:
     field1: b, c, d

and an array:

when: 
     field1:
         - b
         - c 
         - d

Neither of these ideas was in the documentation so i didn’t expect this to work.
Having said that, do you think that it might be a good idea to improve this property?
Do I have to turn to a bit of js to get my way around or is there something I’m missing?

Edit : By the way, version 3.5 with its layouts and blocks f*ck**g rocks! :wink:

1 Like

I’d love to see this too. There is a feature request at More extensive field conditions · Kirby Feedback (which also links to the discussions on GitHub)

Oh … I forgot to take a look at nolt.
Very promising discussion …
Thanks simon! :slight_smile:
In the meantime … can someone confirm to me that a solution should be to extend the vue component responsible for the fields?

I don’t think there’s an easy way to extend the field conditions functionality. It remains to be my most wanted feature request and I tried extending the code myself.

I think the relevant code is this meetsCondition function in the fieldset and section components: kirby/Fieldset.vue at 0d2751af7cb478df14f30fac47fe9a2cd3b38114 · getkirby/kirby · GitHub.

Thanks Thomas !
I wanna take a look on it.