This key represents a query string value for the hidden key that conditionally hides an input based on another input's value.
The value is a string that references a sibling input key name. CloudCannon evaluates the referenced input's value to determine whether to hide this input.
When the referenced input is truthy, CloudCannon hides this input. You can reverse this behavior by prefixing the string with !.
For reverse values in YAML files, the string should be wrapped in single or double quotation marks.
Appears in
└── hidden
└── Query String HiddenType
string
Examples
In this example, we have configured an input to be hidden when the published input is truthy.
Copied to clipboard
_inputs:
published:
type: checkbox
label: Published
draft_notes:
type: textarea
label: Draft notes
hidden: published{
"_inputs": {
"published": {
"type": "checkbox",
"label": "Published"
},
"draft_notes": {
"type": "textarea",
"label": "Draft notes",
"hidden": "published"
}
}
}In this example, we have configured an input to be hidden when the published input is falsy using the ! prefix.
Copied to clipboard
_inputs:
published:
type: checkbox
label: Published
publish_date:
type: datetime
label: Publish date
hidden: '!published'{
"_inputs": {
"published": {
"type": "checkbox",
"label": "Published"
},
"publish_date": {
"type": "datetime",
"label": "Publish date",
"hidden": "!published"
}
}
}