Inputs Reference

Last modified: July 3rd, 2025

An Input is an editing interface for structured data in your data files or the front matter of markup files. Inputs appear in the Data Editor, as well as in the sidebar and data panels of the Content and Visual Editors.

This article covers all keys available in CloudCannon for configuring your Inputs. For more information, please read our documentation on Inputs in general and

All Inputs options are configured within the _inputs key in your CloudCannon configuration file.

_inputs — Object#

This key defines which inputs are available at a given level of the configuration cascade.

The following nested keys are available for each input inside _inputs:

  • type
  • label
  • comment
  • context
  • hidden
  • disabled
  • instance_value
  • cascade
  • options

This key has no default. If undefined at higher levels of the configuration cascade, _inputs will default to any values configured in the CloudCannon configuration file.

Show exampleHide example

In this example, we have configured the date_created Date input, which will automatically populate when you create a file using this input. Editors cannot alter this input as the interface is disabled.

cloudcannon.config.yaml
copied
_inputs:
  date_created:
    type: datetime
    label: Date of article creation
    comment: UTC +0 timezone
    context:
      open: false
      title: Help
      icon: help
      content: This date field will automatically populate when you create an article.
    hidden: false
    disabled: true
    instance_value: NOW
    cascade: true
    options:
      timezone: Etc/UTC
cloudcannon.config.json
copied
{
  "_inputs": {
    "date_created": {
      "type": "datetime",
      "label": "Date of article creation",
      "comment": "UTC +0 timezone",
      "context": {
        "open": false,
        "title": "Help",
        "icon": "help",
        "content": "This date field will automatically populate when you create an article."
      },
      "hidden": false,
      "disabled": true,
      "instance_value": "NOW",
      "cascade": true,
      "options": {
        "timezone": "Etc/UTC"
      }
    }
  }
}

In this example, we have configured the blog_tags Multiselect input for the blog Collection.

cloudcannon.config.yaml
copied
collections_config:
  blog:
    _inputs:
      blog_tags:
        type: multiselect
        label: Blog type
        comment: Select a blog type
        context:
          open: false
          title: Help
          icon: help
          content: |
            Blog tags help our users filter articles by topic.
        options:
          values:
            - Opinion
            - Feature
            - Resource
cloudcannon.config.json
copied
{
  "collections_config": {
    "blog": {
      "_inputs": {
        "blog_tags": {
          "type": "multiselect",
          "label": "Blog type",
          "comment": "Select a blog type",
          "context": {
            "open": false,
            "title": "Help",
            "icon": "help",
            "content": "Blog tags help our users filter articles by topic.\n"
          },
          "options": {
            "values": [
              "Opinion",
              "Feature",
              "Resource"
            ]
          }
        }
      }
    }
  }
}

General input configuration keys#

These keys configure the appearance and functionality of all inputs, regardless of type.

_inputs.*.type — String#

This key changes the type of editing interface used for an Input. Each Input type has a different appearance and functionality, processes and accepts different types of values, and has different configuration options.

Value can be one of the following: auto, checkbox, switch, code, color, datetime, date, time, file, document, image, number, range, object, array, select, multiselect, choice, multichoice, text, textarea, email, html, markdown, or url.

If the type or value of an Input is misconfigured, CloudCannon will display an orange warning instead of an Input. If type is not configured for an Input, CloudCannon will attempt to determine Input type based on value or key name conventions.

This key has no default.

Show exampleHide example

In this example, we have configured the page_description Input as a markdown Rich Text Input using the type key.

cloudcannon.config.yaml
copied
_inputs:
  page_description:
    type: markdown
    options:
      show_count: true
cloudcannon.config.json
copied
{
  "_inputs": {
    "page_description": {
      "type": "markdown",
      "options": {
        "show_count": true
      }
    }
  }
}

In this example, we have configured the related_links Input as a URL Input using the type key.

cloudcannon.config.yaml
copied
_inputs:
  related_links:
    type: url
    comment: Reference a different page
cloudcannon.config.json
copied
{
  "_inputs": {
    "related_links": {
      "type": "url",
      "comment": "Reference a different page"
    }
  }
}
_inputs.*.label — String#

This key changes the bold title text above an Input.

By default, CloudCannon generates the value from the Input key name, in title case (e.g., page_title will become "Page Title").

Show exampleHide example

In this example, we want to customize the label for our page_title Input to be more descriptive.

cloudcannon.config.yaml
copied
_inputs:
  page_title:
    type: text
    label: Article Title
    comment: Enter the main title for this article
cloudcannon.config.json
copied
{
  "_inputs": {
    "page_title": {
      "type": "text",
      "label": "Article Title",
      "comment": "Enter the main title for this article"
    }
  }
}
_inputs.*.comment — String#

This key changes the subtitle text above an Input. CloudCannon supports a limited selection of Markdown formatting for the value of this key: links, bold, italic, subscript, superscript, and inline code.

This key has no default.

Show exampleHide example

In this example, we want to add helpful guidance for our page_description Input.

cloudcannon.config.yaml
copied
_inputs:
  page_description:
    type: text
    label: Page Description
    comment: Enter a brief description of this page for search engines
cloudcannon.config.json
copied
{
  "_inputs": {
    "page_description": {
      "type": "text",
      "label": "Page Description",
      "comment": "Enter a brief description of this page for search engines"
    }
  }
}
_inputs.*.context — Object#

This key enables you to define a context box for extra information about an Input. The following nested keys are available:

  • open
  • title
  • icon
  • content (required)

This key has no default.

Show exampleHide example

In this example, we want to add a context box to our date_created Input to explain its purpose.

cloudcannon.config.yaml
copied
_inputs:
  date_created:
    type: datetime
    label: Date of article creation
    instance_value: NOW
    context:
      open: false
      title: Help
      icon: help
      content: This date field will automatically populate when you create an article.
cloudcannon.config.json
copied
{
  "_inputs": {
    "date_created": {
      "type": "datetime",
      "label": "Date of article creation",
      "instance_value": "NOW",
      "context": {
        "open": false,
        "title": "Help",
        "icon": "help",
        "content": "This date field will automatically populate when you create an article."
      }
    }
  }
}
_inputs.*.context.open — Boolean#

This key determines whether the context box is open to display text content by default.

By default, this key is false (i.e., closed).

Show exampleHide example

In this example, we want the context box to be open by default so users can immediately see the help information.

cloudcannon.config.yaml
copied
_inputs:
  seo_description:
    type: text
    label: SEO Description
    context:
      open: true
      title: SEO Guidelines
      icon: info
      content: >-
        Keep descriptions between 150-160 characters for optimal search engine
        display.
cloudcannon.config.json
copied
{
  "_inputs": {
    "seo_description": {
      "type": "text",
      "label": "SEO Description",
      "context": {
        "open": true,
        "title": "SEO Guidelines",
        "icon": "info",
        "content": "Keep descriptions between 150-160 characters for optimal search engine display."
      }
    }
  }
}
_inputs.*.context.title — String#

This key determines the title of the context box.

By default, this key value is "Context".

Show exampleHide example

In this example, we want to customize the context box title to be more descriptive for our author_bio Input.

cloudcannon.config.yaml
copied
_inputs:
  author_bio:
    type: textarea
    label: Author Biography
    context:
      title: Writing Guidelines
      icon: edit
      content: >-
        Write a brief, professional biography (2-3 sentences) that highlights
        your expertise and experience.
cloudcannon.config.json
copied
{
  "_inputs": {
    "author_bio": {
      "type": "textarea",
      "label": "Author Biography",
      "context": {
        "title": "Writing Guidelines",
        "icon": "edit",
        "content": "Write a brief, professional biography (2-3 sentences) that highlights your expertise and experience."
      }
    }
  }
}
_inputs.*.context.icon — String#

This key determines which icon appears next to the context box title. The value must match an icon name from Google's Material Icons list.

This key has no default.

Show exampleHide example

In this example, we want to use a warning icon to draw attention to important information about our file_upload Input.

cloudcannon.config.yaml
copied
_inputs:
  file_upload:
    type: file
    label: Upload Document
    context:
      title: File Requirements
      icon: warning
      content: Maximum file size is 10MB.
    options:
      max_file_size: 10000
cloudcannon.config.json
copied
{
  "_inputs": {
    "file_upload": {
      "type": "file",
      "label": "Upload Document",
      "context": {
        "title": "File Requirements",
        "icon": "warning",
        "content": "Maximum file size is 10MB."
      },
      "options": {
        "max_file_size": 10000
      }
    }
  }
}
_inputs.*.context.content — String#

This key determines the text content inside the context box. CloudCannon supports a limited selection of Markdown formatting for the value of this key: links, headings, bold, italic, subscript, superscript, and inline code.

This key is required for the context object to function.

This key has no default.

Show exampleHide example

In this example, we want to provide detailed guidance for our blog_tags Input.

cloudcannon.config.yaml
copied
_inputs:
  blog_tags:
    type: multiselect
    label: Blog Tags
    context:
      title: Tag Guidelines
      icon: help
      content: >
        # Tag Guidelines


        Choose 3-5 relevant tags that best describe this article. Tags help
        readers find related content and improve SEO.


        **Good examples:** technology, web development, tutorials

        **Avoid:** generic terms like "blog" or "article"
cloudcannon.config.json
copied
{
  "_inputs": {
    "blog_tags": {
      "type": "multiselect",
      "label": "Blog Tags",
      "context": {
        "title": "Tag Guidelines",
        "icon": "help",
        "content": "# Tag Guidelines\n\nChoose 3-5 relevant tags that best describe this article. Tags help readers find related content and improve SEO.\n\n**Good examples:** technology, web development, tutorials\n**Avoid:** generic terms like \"blog\" or \"article\"\n"
      }
    }
  }
}
_inputs.*.options — Object#

This key determines the configuration specific to each input type. If this key and nested keys are not defined, CloudCannon will use the default configuration options for that input type.

This key has no default.

For more information on options, please read our documentation on each input type.

_inputs.*.hidden — Boolean or string#

This key toggles the visibility of an input in the Data Editor or the sidebar of the Visual or Content Editor. Hidden inputs are useful when you want an input to exist, but not be visible or editable outside of the Source Editor.

Value can be a boolean or a string. A boolean value of true will hide the input.

A string value can hide an input based on the value of another input. You can reverse the value with a ! character at the beginning.

  • published hides an input when the sibling input published is truthy
  • !published hides an input when the sibling input published is falsy

For reverse values in YAML files, the string should be in ' or " quotation marks.

By default, this key follows the input naming convention where key names beginning with an underscore are hidden true.

_inputs.*.disabled — Boolean or string#

This key toggles whether the value of an input is editable in the Data Editor or the sidebar of the Visual or Content Editor. Disabled inputs are useful if you want CloudCannon to display the input value, but prevent team members from editing the value outside of the Source Editor.

The value of this key can be a boolean or a string. A boolean value of true will prevent team members from editing the value.

A string value can prevent team members from editing an input based on the value of another input. You can reverse the value with a ! character at the beginning.

  • published hides an input when the sibling input published is truthy
  • !published hides an input when the sibling input published is falsy

For reverse values in YAML files, the string should be in ' or " quotation marks.

By default, this key is false (i.e., team members can edit input values).

Show exampleHide example

In this example, we have configured the date_created Date input, which will automatically populate when you create a file using this input. Editors cannot alter this input as the interface is disabled.

cloudcannon.config.yaml
copied
_inputs:
  date_created:
    type: datetime
    label: Date of article creation
    comment: UTC +0 timezone
    disabled: true
    instance_value: NOW
    options:
      timezone: Etc/UTC
cloudcannon.config.json
copied
{
  "_inputs": {
    "date_created": {
      "type": "datetime",
      "label": "Date of article creation",
      "comment": "UTC +0 timezone",
      "disabled": true,
      "instance_value": "NOW",
      "options": {
        "timezone": "Etc/UTC"
      }
    }
  }
}
_inputs.*.instance_value — String#

This key determines whether an input is automatically populated with a value when the input is created. This occurs when creating a new file, or adding array items containing this input.

Valid values are UUID or NOW.

  • UUID generates a uuidv4 key (extremely unlikely to generate duplicates), useful for identifying unique items (e.g. 6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b)
  • NOW generates the current datetime in the Site's configured timezone

This key has no default.

_inputs.*.cascade — Boolean#

This key determines whether CloudCannon should merge this input configuration with any matching, less specific configurations elsewhere in the configuration cascade.

The configuration cascade works by finding the most specific _inputs entry. Usually, once an option is found in the cascade, there's no reason to keep looking. When this key is true, the cascade continues looking and each entry found is merged.

This key allows you to define some options globally while using specific options for other keys at different levels of the cascade. For example, define a comment globally, but use collection-specific label for inputs in different collections. You can stop the cascade at any point in the configuration cascade by setting cascade to false.

By default, this key is true (i.e., merges all configurations for an input in the cascade).

Specific input configuration keys#

These keys configure the appearance and functionality for specific input types.

Input validation#

These keys configure how CloudCannon determines a valid value before you can save changes.

_inputs.*.options.required — Boolean#

This key toggles whether CloudCannon requires this Input to have a value. If set to true, CloudCannon will require you to enter a value to save your changes, or discard your unsaved changes.

By default, this key is false (i.e, CloudCannon does not require this Input to have a value).

This key is available for Array, Boolean, Code, Color, Date and Time, File, Number, Object, Select and Multiselect, Text, Rich Text, and URL Inputs.

Show exampleHide example

In this example, we want to require our team to enter an author value for markup files with this Input.

cloudcannon.config.yaml
copied
_inputs:
  author:
    type: text
    comment: Enter the name of the author for this blog post.
    options:
      required: true
cloudcannon.config.json
copied
{
  "_inputs": {
    "author": {
      "type": "text",
      "comment": "Enter the name of the author for this blog post.",
      "options": {
        "required": true
      }
    }
  }
}
_inputs.*.options.required_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.required. This key requires you to define options.required.

This key has no default.

This key is available for Array, Boolean, Code, Color, Date and Time, File, Number, Object, Select and Multiselect, Text, Rich Text, and URL Inputs.

Show exampleHide example

In this example, we prompt our team to use enter an Input value using a required message.

cloudcannon.config.yaml
copied
_inputs:
  author:
    type: text
    comment: Enter the name of the author for this blog post.
    options:
      required: true
      required_message: You are not allowed to leave this blank.
cloudcannon.config.json
copied
{
  "_inputs": {
    "author": {
      "type": "text",
      "comment": "Enter the name of the author for this blog post.",
      "options": {
        "required": true,
        "required_message": "You are not allowed to leave this blank."
      }
    }
  }
}
_inputs.*.options.max — Number#

This key defines the maximum numerical value CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from entering a greater numerical value. If the Input already contains a greater numerical value, CloudCannon will require you to enter a valid value to save your changes, or discard your unsaved changes.

Value can be any integer. If options.min is also configured, this key cannot be a lesser number.

This key has no default.

This key is available for Number Inputs.

Show exampleHide example

In this example, we want to add a rating out of five for each article in our travel blog using the rating Input. This Input limits you to a maximum rating of five.

cloudcannon.config.yaml
copied
_inputs:
  rating:
    type: number
    comment: How highly did you rate this experience?
    options:
      max: 5
      min: 1
cloudcannon.config.json
copied
{
  "_inputs": {
    "rating": {
      "type": "number",
      "comment": "How highly did you rate this experience?",
      "options": {
        "max": 5,
        "min": 1
      }
    }
  }
}
_inputs.*.options.max_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.max. This key requires you to define options.max.

This key has no default.

This key is available for Number Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  rating:
    type: number
    comment: How highly did you rate this experience?
    options:
      max: 5
      max_message: Cannot be more than 5
      min: 1
      min_message: Cannot be less than 1
cloudcannon.config.json
copied
{
  "_inputs": {
    "rating": {
      "type": "number",
      "comment": "How highly did you rate this experience?",
      "options": {
        "max": 5,
        "max_message": "Cannot be more than 5",
        "min": 1,
        "min_message": "Cannot be less than 1"
      }
    }
  }
}
_inputs.*.options.min — Number#

This key defines the minimum numerical value CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from entering a lesser numerical value. If the Input already contains a lesser numerical value, CloudCannon will require you to enter a valid value to save your changes, or discard your unsaved changes.

Value can be any integer. If options.max is also configured, this key cannot be a greater number.

This key has no default.

This key is available for Number Inputs.

Show exampleHide example

In this example, we want to add a rating out of five for each article in our travel blog using the rating Input. This Input limits you to a minimum rating of one.

cloudcannon.config.yaml
copied
_inputs:
  rating:
    type: number
    comment: How highly did you rate this experience?
    options:
      max: 5
      min: 1
cloudcannon.config.json
copied
{
  "_inputs": {
    "rating": {
      "type": "number",
      "comment": "How highly did you rate this experience?",
      "options": {
        "max": 5,
        "min": 1
      }
    }
  }
}
_inputs.*.options.min_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.min. This key requires you to define options.min.

This key has no default.

This key is available for Number Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  rating:
    type: number
    comment: How highly did you rate this experience?
    options:
      max: 5
      max_message: Cannot be more than 5
      min: 1
      min_message: Cannot be less than 1
cloudcannon.config.json
copied
{
  "_inputs": {
    "rating": {
      "type": "number",
      "comment": "How highly did you rate this experience?",
      "options": {
        "max": 5,
        "max_message": "Cannot be more than 5",
        "min": 1,
        "min_message": "Cannot be less than 1"
      }
    }
  }
}
_inputs.*.options.max_file_size — String#

This key defines the maximum file size in kB that CloudCannon will allow you to upload. When configured, CloudCannon will prevent you from saving your changes until you select a valid file size, or discard your unsaved changes.

Value can be any positive integer.

This key has no default.

This key is available for File and URL Inputs.

Show exampleHide example

In this example, we want our team to upload an image using the feature_image Input. This Input limits you to a maximum file size of 750 kB.

cloudcannon.config.yaml
copied
_inputs:
  feature_image:
    type: image
    comment: Select the feature image for the banner.
    options:
      max_file_size: 140
cloudcannon.config.json
copied
{
  "_inputs": {
    "feature_image": {
      "type": "image",
      "comment": "Select the feature image for the banner.",
      "options": {
        "max_file_size": 140
      }
    }
  }
}
_inputs.*.options.max_file_size_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.max_file_size. This key requires you to define options.max_file_size.

This key has no default.

This key is available for File and URL Inputs.

Show exampleHide example

In this example, we want our team to upload an image using the feature_image Input. This Input limits you to a maximum file size of 750 kB.

cloudcannon.config.yaml
copied
_inputs:
  feature_image:
    type: image
    comment: Select the feature image for the banner.
    options:
      max_file_size: 140
      max_file_size_message: For SEO, keep this under 140kB
cloudcannon.config.json
copied
{
  "_inputs": {
    "feature_image": {
      "type": "image",
      "comment": "Select the feature image for the banner.",
      "options": {
        "max_file_size": 140,
        "max_file_size_message": "For SEO, keep this under 140kB"
      }
    }
  }
}
_inputs.*.options.max_items — Number#

This key defines the maximum number of items CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from adding more items to this Input. If the Input already contains more items, CloudCannon will require you to remove items until the Input contains a valid number to save your changes, or discard your unsaved changes.

Value can be any positive integer. If options.min_items is also configured, this key cannot be a lesser number.

This key has no default.

This key is available for Array and Multiselect or Multichoice Inputs.

Show exampleHide example

In this example, we want to add an array of filepaths to our homepage's featured_posts Input. This Input limits you to a maximum of five array items.

cloudcannon.config.yaml
copied
_inputs:
  featured_posts:
    type: array
    options:
      max_items: 5
      max_items_message: Cannot be more than 5
      min_items: 2
      min_items_message: Cannot be less than 2
cloudcannon.config.json
copied
{
  "_inputs": {
    "featured_posts": {
      "type": "array",
      "options": {
        "max_items": 5,
        "max_items_message": "Cannot be more than 5",
        "min_items": 2,
        "min_items_message": "Cannot be less than 2"
      }
    }
  }
}
_inputs.*.options.max_items_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.max_items. This key requires you to define options.max_items.

This key has no default.

This key is available for Array and Multiselect or Multichoice Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number of items using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  featured_posts:
    type: array
    options:
      max_items: 5
      max_items_message: Cannot be more than 5
      min_items: 2
      min_items_message: Cannot be less than 2
cloudcannon.config.json
copied
{
  "_inputs": {
    "featured_posts": {
      "type": "array",
      "options": {
        "max_items": 5,
        "max_items_message": "Cannot be more than 5",
        "min_items": 2,
        "min_items_message": "Cannot be less than 2"
      }
    }
  }
}
_inputs.*.options.min_items — Number#

This key defines the minimum number of items CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from removing items from this Input below this value. If the Input already contains fewer items, CloudCannon will require you to add items until the Input contains a valid number to save your changes, or discard your unsaved changes.

Value can be any positive integer. If options.min_items is also configured, this key cannot be a greater number.

This key has no default.

This key is available for Array and Multiselect or Multichoice Inputs.

Show exampleHide example

In this example, we want to add an array of filepaths to our homepage's featured_posts Input. This Input limits you to a maximum of two array items.

cloudcannon.config.yaml
copied
_inputs:
  featured_posts:
    type: array
    options:
      max_items: 5
      max_items_message: Cannot be more than 5
      min_items: 2
      min_items_message: Cannot be less than 2
cloudcannon.config.json
copied
{
  "_inputs": {
    "featured_posts": {
      "type": "array",
      "options": {
        "max_items": 5,
        "max_items_message": "Cannot be more than 5",
        "min_items": 2,
        "min_items_message": "Cannot be less than 2"
      }
    }
  }
}
_inputs.*.options.min_items_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.min_items. This key requires you to define options.min_items.

This key has no default.

This key is available for Array and Multiselect or Multichoice Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number of items using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  featured_posts:
    type: array
    options:
      max_items: 5
      max_items_message: Cannot be more than 5
      min_items: 2
      min_items_message: Cannot be less than 2
cloudcannon.config.json
copied
{
  "_inputs": {
    "featured_posts": {
      "type": "array",
      "options": {
        "max_items": 5,
        "max_items_message": "Cannot be more than 5",
        "min_items": 2,
        "min_items_message": "Cannot be less than 2"
      }
    }
  }
}
_inputs.*.options.max_length — Number#

This key defines the maximum string length, in characters, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too long. If the Input already contains a longer value, CloudCannon will require you to remove characters until the Input contains a valid string to save your changes, or discard your unsaved changes.

Value can be any non-negative integer. If this key is set to 0, CloudCannon requires the Input to be empty. If options.min_length is also configured, this key cannot be a smaller number.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs. To use this key in a Select Input, allow_create must be set to true.

Show exampleHide example

In this example, we want our team to enter a blog description using the Rich Text seo_description Input. This Input limits you to a maximum of 125 characters.

cloudcannon.config.yaml
copied
_inputs:
  seo_description:
    type: markdown
    comment: Enter a brief description of this blog.
    options:
      max_length: 125
      min_length: 25
cloudcannon.config.json
copied
{
  "_inputs": {
    "seo_description": {
      "type": "markdown",
      "comment": "Enter a brief description of this blog.",
      "options": {
        "max_length": 125,
        "min_length": 25
      }
    }
  }
}
_inputs.*.options.max_length_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.max_length. This key requires you to define options.max_length.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number of characters using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  seo_description:
    type: markdown
    comment: Enter a brief description of this blog.
    options:
      max_length: 125
      max_length_message: You are only allowed 125 characters.
      min_length: 25
      min_length_message: Please write more than 25 characters.
cloudcannon.config.json
copied
{
  "_inputs": {
    "seo_description": {
      "type": "markdown",
      "comment": "Enter a brief description of this blog.",
      "options": {
        "max_length": 125,
        "max_length_message": "You are only allowed 125 characters.",
        "min_length": 25,
        "min_length_message": "Please write more than 25 characters."
      }
    }
  }
}
_inputs.*.options.min_length — Number#

This key defines the minimum string length, in characters, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too short. If the Input already contains a shorter value, CloudCannon will require you to add characters until the Input contains a valid string to save your changes, or discard your unsaved changes.

Value can be any positive integer. If options.max_length is also configured, this key cannot be a greater number.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs. To use this key in a Select Input, allow_create must be set to true.

Show exampleHide example

In this example, we want our team to enter a blog description using the Rich Text seo_description Input. This Input requires a minimum of 25 characters.

cloudcannon.config.yaml
copied
_inputs:
  seo_description:
    type: markdown
    comment: Enter a brief description of this blog.
    options:
      max_length: 125
      min_length: 25
cloudcannon.config.json
copied
{
  "_inputs": {
    "seo_description": {
      "type": "markdown",
      "comment": "Enter a brief description of this blog.",
      "options": {
        "max_length": 125,
        "min_length": 25
      }
    }
  }
}
_inputs.*.options.min_length_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.min_length. This key requires you to define options.min_length.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid number of characters using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  seo_description:
    type: markdown
    comment: Enter a brief description of this blog.
    options:
      max_length: 125
      max_length_message: You are only allowed 125 characters.
      min_length: 25
      min_length_message: Please write more than 25 characters.
cloudcannon.config.json
copied
{
  "_inputs": {
    "seo_description": {
      "type": "markdown",
      "comment": "Enter a brief description of this blog.",
      "options": {
        "max_length": 125,
        "max_length_message": "You are only allowed 125 characters.",
        "min_length": 25,
        "min_length_message": "Please write more than 25 characters."
      }
    }
  }
}
_inputs.*.options.pattern — String#

This key defines a regular expression that the Input value must match. When configured, CloudCannon will require you to enter a value that matches the REGEX pattern. If the Input already contains an invalid value, CloudCannon will require you to enter a valid string to save your changes, or discard your unsaved changes.

Value must be a valid REGEX string.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs. To use this key in a Select Input, allow_create must be set to true.

Show exampleHide example

In this example, we want our team to add an email address to the contact_email Input using the correct email format.

cloudcannon.config.yaml
copied
_inputs:
  contact_email:
    type: email
    options:
      pattern: '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
      pattern_message: Please use the format ___@___.__
cloudcannon.config.json
copied
{
  "_inputs": {
    "contact_email": {
      "type": "email",
      "options": {
        "pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
        "pattern_message": "Please use the format ___@___.__"
      }
    }
  }
}
_inputs.*.options.pattern_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.pattern. This key requires you to define options.pattern.

This key has no default.

This key is available for Code, Color, File, Select, Text, Rich Text, and URL Inputs.

Show exampleHide example

In this example, we prompt our team to use the correct email format in the contact_email Input using a pattern message.

cloudcannon.config.yaml
copied
_inputs:
  contact_email:
    type: email
    options:
      pattern: '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
      pattern_message: Please use the format ___@___.__
cloudcannon.config.json
copied
{
  "_inputs": {
    "contact_email": {
      "type": "email",
      "options": {
        "pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
        "pattern_message": "Please use the format ___@___.__"
      }
    }
  }
}
_inputs.*.options.start_from — Date#

This key defines the earliest date and time, inclusive, that CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from selecting an earlier date and time. If the Input already contains an earlier date and time, CloudCannon will require you to change it to a valid value to save your changes, or discard your unsaved changes.

Value must be in ISO8601 format. If options.end_before is also configured, this key cannot be a later date and time.

This key has no default.

This key is available for Date and Time Inputs.

Show exampleHide example

In this example, we want our team to enter the date and time of an event in the 2022_event Input. This Input will only allow dates on or after January 1st, 2022.

cloudcannon.config.yaml
copied
_inputs:
  2022_event:
    type: datetime
    options:
      start_from: 2022-01-01T00:00:00.000Z
      end_before: 2023-01-01T00:00:00.000Z
cloudcannon.config.json
copied
{
  "_inputs": {
    "2022_event": {
      "type": "datetime",
      "options": {
        "start_from": "2022-01-01T00:00:00.000Z",
        "end_before": "2023-01-01T00:00:00.000Z"
      }
    }
  }
}
_inputs.*.options.start_from_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.start_from. This key requires you to define options.start_from.

This key has no default.

This key is available for Date and Time Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid date using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  2022_event:
    type: datetime
    options:
      start_from: 2022-01-01T00:00:00.000Z
      start_from_message: Date is too early. Must be during 2022.
      end_before: 2023-01-01T00:00:00.000Z
      end_before_message: Date is too late. Must be during 2022.
cloudcannon.config.json
copied
{
  "_inputs": {
    "2022_event": {
      "type": "datetime",
      "options": {
        "start_from": "2022-01-01T00:00:00.000Z",
        "start_from_message": "Date is too early. Must be during 2022.",
        "end_before": "2023-01-01T00:00:00.000Z",
        "end_before_message": "Date is too late. Must be during 2022."
      }
    }
  }
}
_inputs.*.options.end_before — Date#

This key defines the date and time, exclusive, that CloudCannon will allow in an Input. When configured, CloudCannon will prevent you from selecting a later date and time. If the Input already contains a later date and time, CloudCannon will require you to change it to a valid value to save your changes, or discard your unsaved changes.

Value must be in ISO8601 format. If options.start_from is also configured, this key cannot be an earlier date and time.

This key has no default.

This key is available for Date and Time Inputs.

Show exampleHide example

In this example, we want our team to enter the date and time of an event in the 2022_event Input. This Input will only allow dates before January 1st, 2023.

cloudcannon.config.yaml
copied
_inputs:
  2022_event:
    type: datetime
    options:
      start_from: 2022-01-01T00:00:00.000Z
      end_before: 2023-01-01T00:00:00.000Z
cloudcannon.config.json
copied
{
  "_inputs": {
    "2022_event": {
      "type": "datetime",
      "options": {
        "start_from": "2022-01-01T00:00:00.000Z",
        "end_before": "2023-01-01T00:00:00.000Z"
      }
    }
  }
}
_inputs.*.options.end_before_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.end_before. This key requires you to define options.end_before.

This key has no default.

This key is available for Date and Time Inputs.

Show exampleHide example

In this example, we prompt our team to enter a valid date using a custom message.

cloudcannon.config.yaml
copied
_inputs:
  2022_event:
    type: datetime
    options:
      start_from: 2022-01-01T00:00:00.000Z
      start_from_message: Date is too early. Must be during 2022.
      end_before: 2023-01-01T00:00:00.000Z
      end_before_message: Date is too late. Must be during 2022.
cloudcannon.config.json
copied
{
  "_inputs": {
    "2022_event": {
      "type": "datetime",
      "options": {
        "start_from": "2022-01-01T00:00:00.000Z",
        "start_from_message": "Date is too early. Must be during 2022.",
        "end_before": "2023-01-01T00:00:00.000Z",
        "end_before_message": "Date is too late. Must be during 2022."
      }
    }
  }
}
_inputs.*.options.unique_on — String#

This key defines the JSON Path selector that CloudCannon should use to determine if the value of an Input is unique. When configured, CloudCannon will require the value of the Input to be unique compared to the value defined on the JSON Path. If the Input already contains a non-unique value, CloudCannon will require you to change it to a valid value to save your changes, or discard your unsaved changes.

Value must be a valid JSON Path.

This key has no default.

This key is available for Array, Multiselect, and Multichoice inputs.

Show exampleHide example

In this example, we want our team to add article filepaths to the related_articles Input. This Input requires all the filepaths to be unique.

cloudcannon.config.yaml
copied
_inputs:
  related_articles:
    type: array
    options:
      unique_on: $.path
cloudcannon.config.json
copied
{
  "_inputs": {
    "related_articles": {
      "type": "array",
      "options": {
        "unique_on": "$.path"
      }
    }
  }
}
blog-article.yaml
copied
related_articles:
  - path: /articles/first-article.md
    featured: true
  - path: /articles/second-article.md
    featured: false
_inputs.*.options.unique_on_message — String#

This key defines a custom error message that explains why a value has failed the validation criteria from options.unique_on. This key requires you to define options.unique_on.

This key has no default.

This key is available for Array, Multiselect, and Multichoice inputs.

Show exampleHide example

In this example, we want our team to add article filepaths to the related_articles Input. This Input requires all the filepaths to be unique.

cloudcannon.config.yaml
copied
_inputs:
  related_articles:
    type: array
    options:
      unique_on: $.path
      unique_on_message: The value for path must be different for all items.
cloudcannon.config.json
copied
{
  "_inputs": {
    "related_articles": {
      "type": "array",
      "options": {
        "unique_on": "$.path",
        "unique_on_message": "The value for path must be different for all items."
      }
    }
  }
}
blog-article.yaml
copied
related_articles:
  - path: /articles/first-article.md
    featured: true
  - path: /articles/first-article.md
    featured: false

Open in a new tab