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

view_options

Table of contents

Description:

This key defines the options for the View dropdown in the Collection browser.

The value is an array of view option strings. The first option listed is used as the default view.

Appears in:
└── collections_config
    └── *
        └── view_options
Type:
Array<view_options[*]>
Items:
[*]string#

This key represents an individual view option string in the collections_config.*.view_options array.

The value is a string that specifies a view option for the View dropdown in the Collection browser. The first option listed is used as the default view.

Allowed values: card list gallery

Show examplesHide examples

In this example, we have configured a view option for the developer_articles Collection.

Copied to clipboard
collections_config:
  developer_articles:
    path: developer/articles
    icon: article
    view_options:
      - card
{
  "collections_config": {
    "developer_articles": {
      "path": "developer/articles",
      "icon": "article",
      "view_options": [
        "card"
      ]
    }
  }
}

All items must be unique.

Examples:

In this example, we have configured three view options for the developer_articles Collection, with card as the default view.

Copied to clipboard
collections_config:
  developer_articles:
    path: developer/articles
    icon: article
    view_options:
      - card
      - list
      - gallery
{
  "collections_config": {
    "developer_articles": {
      "path": "developer/articles",
      "icon": "article",
      "view_options": [
        "card",
        "list",
        "gallery"
      ]
    }
  }
}
Open in a new tab