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

add_options

Table of contents

Description:

This key defines the options available in the + Add button dropdown at the top right of your Collection browser.

Configuring add options for a Collection will remove CloudCannon's default "Add a file" option from the + Add button dropdown.

Additionally, any Schemas you have configured for a Collection will also appear in the + Add dropdown.

Appears in:
└── collections_config
    └── *
        └── add_options
Type:
Array<add_options[*]>
Items:

This key represents an individual add option object in the collections_config.*.add_options array.

The value is an object that defines an option available in the + Add button dropdown at the top right of the Collection browser. Each add option can be a standard entry or a URL entry, each with their own properties.

Show examplesHide examples

In this example, we have configured a standard add option for the people Collection that uses the employee Schema and opens files in the Data Editor.

Copied to clipboard
collections_config:
  people:
    add_options:
      - name: Add Staff Member
        schema: employee
        icon: face
        editor: data
    schemas:
      employee:
        path: /.cloudcannon/schemas/employee.yml
{
  "collections_config": {
    "people": {
      "add_options": [
        {
          "name": "Add Staff Member",
          "schema": "employee",
          "icon": "face",
          "editor": "data"
        }
      ],
      "schemas": {
        "employee": {
          "path": "/.cloudcannon/schemas/employee.yml"
        }
      }
    }
  }
}

In this example, the + Add button dropdown in the team Collection browser has a link to the Office Locations page on our live website.

Copied to clipboard
collections_config:
  team:
    add_options:
      - name: Office Locations
        icon: map
        href: /our-offices
{
  "collections_config": {
    "team": {
      "add_options": [
        {
          "name": "Office Locations",
          "icon": "map",
          "href": "/our-offices"
        }
      ]
    }
  }
}
Examples:

In this example, we have configured two standard add options for the people Collection. The first option uses the employee Schema, and the second option uses the contractor Schema and opens files in the Data Editor.

Copied to clipboard
collections_config:
  people:
    add_options:
      - name: Add Staff Member
        schema: employee
        icon: face
        editor: data
      - name: Add Contractor
        icon: support_agent
        schema: contractor
        editor: data
    schemas:
      employee:
        path: /.cloudcannon/schemas/employee.yml
      contractor:
        path: /.cloudcannon/schemas/contractor.yml
{
  "collections_config": {
    "people": {
      "add_options": [
        {
          "name": "Add Staff Member",
          "schema": "employee",
          "icon": "face",
          "editor": "data"
        },
        {
          "name": "Add Contractor",
          "icon": "support_agent",
          "schema": "contractor",
          "editor": "data"
        }
      ],
      "schemas": {
        "employee": {
          "path": "/.cloudcannon/schemas/employee.yml"
        },
        "contractor": {
          "path": "/.cloudcannon/schemas/contractor.yml"
        }
      }
    }
  }
}

In this example, the + Add button dropdown in the team Collection browser has a link to the Office Locations page on our live website.

Copied to clipboard
collections_config:
  team:
    add_options:
      - name: Office Locations
        icon: map
        href: /our-offices
{
  "collections_config": {
    "team": {
      "add_options": [
        {
          "name": "Office Locations",
          "icon": "map",
          "href": "/our-offices"
        }
      ]
    }
  }
}
Open in a new tab