Using Arrays to edit your data

Arrays are one of the most powerful parts of any SSG. They can be used for a wide range of use cases, from small lists of strings to full component builders.

This document will show the two types of arrays that can exist and how they are treated within CloudCannon. The array editor will give your editors:

  • Drag and drop reordering
  • Configurable add options at any index
  • Intuitive editing
  • Easy removal of items

There is no setup, just add your data and see the editor show up.

Simple Arrays

Simple arrays or primitive arrays are an array of strings or numbers. The array editor will give you a way edit these items directly in a list.

The array editor with draggable handles, editable text and an option to add new content.
Front Matter
staff:
  - Bill
  - Ben
  - Badger

Arrays of Objects

Arrays of objects allow your editors to add and edit objects of any complexity. When your data can be infinitely recursive, there is no end to what can be achieved. Connect this array with a loop on your site to create endless editing opportunities.

Clicking each item in the list will open the object in their own column. For more information on this, see the documentation on Objects.

The array editor with a list of staff members including their thumbnail image and name
The array editor with a list of staff members including their thumbnail image and name
Front Matter
quotes:
  - name: 'Betty Jefferson'
    position: 'Jamstack Developer'
    image: /images/betty.svg
    quote_markdown: '“This quotation can be edited via the front matter textarea input.”'
  - name: 'Jamie Mills'
    position: 'Jamstack Developer'
    image: /images/jamie.svg
    quote_markdown: '“You can also reorder quotations via the front matter arrays input.”'
Was this article helpful? or Suggest an improvement >