- Description:
This key represents the standard add option entry in a
collections_config.*.add_optionsarray.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, anddefault_content_filekeys.- Appears in:
└── collections_config └── * └── add_options └── [*] └── Add Option- Type:
Object- Properties:
This key defines a path for files created using an option in the + Add button dropdown.
This path overrides the path for the current Collection and subfolder open in the Collection browser.
This key is useful if you need to specify a specific subfolder within a Collection.
Show examplesHide examples
In this example, we want team members in the
_postsCollection to create new files in theblogsubfolder of the_draftsCollection rather than the current Collection browser they have open. By configuring thebase_pathvalue to/../_drafts/blog, new files will be created in a different Collection subfolder (i.e.,_drafts) when a team member selects this option from the + Add button dropdown.Copied to clipboardcollections_config: _posts: add_options: - name: Add draft blog icon: post_add editor: content base_path: /../_drafts/blog{ "collections_config": { "_posts": { "add_options": [ { "name": "Add draft blog", "icon": "post_add", "editor": "content", "base_path": "/../_drafts/blog" } ] } } }This key defines the Collection for files created using an option in the + Add button dropdown.
This Collections overrides the current Collection open in the Collection browser.
The value for this key should be the key name of a Collection.
By default, this key is the current Collection open in the Collection browser.
Show examplesHide examples
In this example, we want team members in the articles Collection to create new files in the
new_articlesCollection rather than the current Collection browser they have open. By configuring thecollectionvalue tonew_articles, new files will be created in a different Collection (i.e.,new_articles) when a team member selects this option from the + Add button dropdown.Copied to clipboardcollections_config: articles: add_options: - name: Add articles collection: new_articles schema: articles{ "collections_config": { "articles": { "add_options": [ { "name": "Add articles", "collection": "new_articles", "schema": "articles" } ] } } }This key defines which file CloudCannon should use to populate a file created with an option in the + Add button dropdown.
The value is a string that specifies a file path relative to the root of your repository. This file is used to populate the initial contents of a new file if the Collection defined in
add_options.collectionhas no Schemas configured.The
add_options.schemakey will overridedefault_content_fileif configured.Show examplesHide examples
In this example, we want CloudCannon to populate the initial contents of new files with
event_template.yml.Copied to clipboardcollections_config: events: add_options: name: Add new event collection: upcoming_events default_content_file: event_template.yml{ "collections_config": { "events": { "add_options": { "name": "Add new event", "collection": "upcoming_events", "default_content_file": "event_template.yml" } } } }This key defines which editing interface CloudCannon will use when you select an option from the + Add button dropdown.
Values can be one of the following:
visual,content, ordata.By default, CloudCannon will open the new file in an appropriate editing interface for that file type.
If CloudCannon cannot determine an appropriate editing interface, it will show a warning.
Allowed values:
visualcontentdataShow examplesHide examples
In this example, we have configured a standard add option for the
peopleCollection that opens new files in the Data Editor.Copied to clipboardcollections_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 defines the icon displayed next to the text for a standard add option in the + Add button dropdown.
The value is a string that specifies an icon name from Google's Material Symbols.
By default, this key uses the icon of the matching Schema if
add_options.schemais configured. Otherwise, this key defaults toadd.Allowed values:
12336010k10mp11mp12mp13mp14mp15mp16mpand 3574 more.Show examplesHide examples
In this example, we have configured a standard add option for the
peopleCollection with the custom iconsupport_agent.Copied to clipboardcollections_config: people: add_options: - name: Add Contractor icon: support_agent schema: contractor editor: data schemas: contractor: path: /.cloudcannon/schemas/contractor.yml{ "collections_config": { "people": { "add_options": [ { "name": "Add Contractor", "icon": "support_agent", "schema": "contractor", "editor": "data" } ], "schemas": { "contractor": { "path": "/.cloudcannon/schemas/contractor.yml" } } } } }This key defines the text displayed for a standard add option in the + Add button dropdown.
The value is a string that specifies the label text for the menu item.
By default, this key uses the name of the matching Schema if
add_options.schemais configured. Otherwise, this key has no default value.Show examplesHide examples
In this example, we have configured a standard add option for the
peopleCollection with the custom name "Add Staff Member".Copied to clipboardcollections_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 defines which Schema CloudCannon should use to populate a file created with a standard add option in the + Add button dropdown.
The value is a string that specifies the key name of a Schema defined in
schemasto use as the default content for the new file.Configuring this key will override
add_options.default_content_file.By default, this key uses the default Schema in the Collection configured in
add_options.collection(or the containing collection ifcollectionis not specified), if Schemas are configured for that collection. Otherwise, this key has no default value.Show examplesHide examples
In this example, we have configured a standard add option for the
peopleCollection that uses theemployeeSchema to populate new files.Copied to clipboardcollections_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" } } } } }- Examples:
In this example, we have configured a standard add option for the
peopleCollection that uses theemployeeSchema and opens files in the Data Editor.Copied to clipboardcollections_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" } } } } }