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

values

Table of contents

Description:

This key defines the options available for a Structure.

You must define this key for the Structure to function.

This key has no default.

Appears in:
└── Structure
    └── values
Type:
Array<values[*]> Required
Items:
[*]Object#

This key represents a single value option within a structure, defining the data format and appearance for content editors.

Examples:

In this example, we want to add the title, subtitle, author, featured_image, and url fields to Object or Array inputs that reference this Structure.

Copied to clipboard
_structures:
  related_articles:
    values:
      - label: Blog
        id: 
        default: true
        tabbed: false
        tags:
          - blog
        value:
          title: 
          subtitle: 
          author: 
          featured_image: 
          url: 
        _inputs:
          featured_image:
            type: image
            options:
              width: 50
              height: 50
        groups:
          - heading: Titles
            inputs:
              - title
              - subtitle
          - heading: Details
            inputs:
              - author
              - image
              - url
        preview:
          text:
            - template: '{title}'
          subtext:
            - template: By {author}
          image:
            - key: image
        picker_preview:
          text: Blog
          subtext: Add a related blog
          icon: post_add
{
  "_structures": {
    "related_articles": {
      "values": [
        {
          "label": "Blog",
          "id": null,
          "default": true,
          "tabbed": false,
          "tags": [
            "blog"
          ],
          "value": {
            "title": null,
            "subtitle": null,
            "author": null,
            "featured_image": null,
            "url": null
          },
          "_inputs": {
            "featured_image": {
              "type": "image",
              "options": {
                "width": 50,
                "height": 50
              }
            }
          },
          "groups": [
            {
              "heading": "Titles",
              "inputs": [
                "title",
                "subtitle"
              ]
            },
            {
              "heading": "Details",
              "inputs": [
                "author",
                "image",
                "url"
              ]
            }
          ],
          "preview": {
            "text": [
              {
                "template": "{title}"
              }
            ],
            "subtext": [
              {
                "template": "By {author}"
              }
            ],
            "image": [
              {
                "key": "image"
              }
            ]
          },
          "picker_preview": {
            "text": "Blog",
            "subtext": "Add a related blog",
            "icon": "post_add"
          }
        }
      ]
    }
  }
}
Open in a new tab