☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Query String Hidden

Table of contents

Description:

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 Hidden
Type:
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"
    }
  }
}
Open in a new tab