Open bnomei opened 4 years ago
actually it currently does not even work for string even with an ===
check. 🤷♂
myfield:
when:
otherfield: "a string"
as a side note if its not a regex //
the it could be interpreted as a query string?
site.find('otherpage').otherfield.toBool
Reflex might be easier possible, query strings not so much. Reason is that the when term is evaluated in Vue directly without API calls. With the query language you might though expect not only a one time value at load but that this is also a constant re-evaluated statement. That would require constant API calls
instead of just an
===
comparison a regex check could be made possible as well here... https://github.com/getkirby/kirby/blob/2b0bfd0b47a308e09117bac95ac674fdf50ce36c/panel/src/components/Forms/Fieldset.vue#L98that would allow
/.+/
or even complex conditional fields like
/(,[^,]*){3,}/
/(\(crazy:[ \w]+\))+/