The options docs for fields don’t make a reference to this, so I’m not sure if this is something already built into Cockpit.
Is there functionality already built into Cockpit that will conditionally show a field based on another field? For example, we create a collection of news items that can sometimes be external links. A boolean field in this collection called “external_link” is toggled on which then shows a hidden Text field for the url. When toggled off, the Text field is hidden.
Could this work within a set field? Either referencing a field in the set (example below) or a top-level field in the entry. Thanks
Hang
{
"fields": [{
"name": "first_name",
"type": "text"
}, {
"name": "last_name",
"info": "you need to provide your last name if you are John"
"type": "text",
"options": {
"@visibility": "$.first_name === 'John'"
}
}]
}
Is this still working in the current version (v2.2.1). I tried on a text field, placing the line in the options field and even the meta > condition field with no success.
Can you provide an example of the whole options field?