Choose your preferred SSG:
Choose your preferred SSG:

Using Object Inputs to edit your data

Object inputs in your data show as a button in the data editor. This button opens a new editor to the side, showing the inputs inside that object. This continues as you click into nested Object inputs. Each object level has a back button to return to the parent scope.

Object inputs are a great way to group related data together, and hiding complicated or infrequently edited data.

Object

Button input to open a new level in the editor scoped to the object value in your data.

Object inputs are shown for inputs configured with the type object, or for object input values.

Screenshot of unopened object input field

Here is how this Object input looks when opened:

Screenshot of active Object input field
Value convention
inputs:
  title: 'Click on this region to edit its contents from the Sidebar.'
  image: '/images/hills.png'
  date: 2021-08-12T18:30:00.000Z
  categories:
    - Documentation
    - CloudCannon
  url: https://cloudcannon.com/documentation/articles/using-objects-to-edit-your-data/
Input configuration
seo:
  title: How to contact us
  description: These are all the ways to contact us
_inputs:
  seo:
    type: object

Options

Object inputs are configured with options inside an _inputs entry.

Input configuration
seo:
  page_title: About
  description: All about us!
  social_image: '/images/hills.png'
_inputs:
  seo:
    type: object
    options:
      text_key: page_title
      subtext_key: description
      image_key: social_image
      icon: travel_explore

Object inputs have the following options available:

structures - String or object

Provides options for value of this object. When choosing an item, team members are prompted to choose from a number of values you have defined. Has no default.

If set as an object, the structures value is used directly.

if set as a string, the structures value is fetched from the configuration cascade. This allows you to define _structures elsewhere and reference it from here.

text_key - String

Controls what key within the object value is used for the display text on the unopened input. Defaults to title, then name, otherwise uses the first value found (prioritizing text-based values).

If the input has structures, the text_key from the structure definition is used instead.

subtext_key - String

Controls what key within the object value is used for the supporting text on the unopened input. Defaults to listing the label of each input inside the object value.

Subtext is hidden if text and subtext is the same. If there’s no text, subtext is used instead.

If the input has structures, the subtext_key from the structure definition is used instead.

image_key - String

Controls what key within the object value is used to display a preview image on the unopened input. Defaults to thumbnail_image, thumbnail_image_path, image, and image_path in that order. If no image is found, icon is displayed instead.

If the input has structures, the image_key from the structure definition is used instead.

icon - String

Sets the icon shown when no image preview is available on the unopened input. Must match a Material Icon name. Defaults to notes.

Was this article helpful? or Suggest an improvement >

Related articles

Other Resources

  1. Material Icons