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

add_options[*]

Table of contents

Description:

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.

Appears in:
└── collections_config
    └── *
        └── add_options
            └── [*]
Types:

This key represents the standard add option entry in a 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. Standard add options can contain optional name, icon, editor, base_path, collection, schema, and default_content_file keys.

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"
        }
      }
    }
  }
}

This key represents the URL add option object in a 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. URL add options must contain a required href key and can contain optional name and icon keys.

Show examplesHide examples

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 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"
        }
      ]
    }
  }
}
Open in a new tab