getkirby / ideas

This is the backlog of ideas and feature requests from the last two years. Use our new feedback platform to post your new ideas or vote on existing ideas.
https://feedback.getkirby.com
20 stars 0 forks source link

Conditional fields: regex support #486

Open bnomei opened 4 years ago

bnomei commented 4 years ago

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#L98

that would allow

or even complex conditional fields like

bnomei commented 4 years ago

actually it currently does not even work for string even with an === check. 🤷‍♂

myfield:
  when:
    otherfield: "a string"
bnomei commented 4 years ago

as a side note if its not a regex // the it could be interpreted as a query string?

distantnative commented 4 years ago

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