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

extra_data

Table of contents

Description:

This key defines additional data placeholders for use in create path templates.

The value is an object where each property is a string that specifies a data placeholder. Entry values follow the same format as path, and are processed sequentially before path. These values are not saved back to your file.

For more information, please read our documentation on Create Paths.

Appears in:
└── create
    └── extra_data
Type:
Object<extra_data.*>
Values:
*string#

This key represents an individual extra data property in the create.extra_data object.

The value is a string that specifies a data placeholder for use in create path templates. Entry values follow the same format as path, and are processed sequentially before path. These values are not saved back to your file.

Show examplesHide examples

In this example, we have configured an extra data property filename that combines date and title fields for use in the create path.

Copied to clipboard
collections_config:
  blog:
    create:
      extra_data:
        filename: '{date|year}-{date|month}-{date|day}-{title}'
      path: '[relative_base_path]/{filename|slugify}.[ext]'
{
  "collections_config": {
    "blog": {
      "create": {
        "extra_data": {
          "filename": "{date|year}-{date|month}-{date|day}-{title}"
        },
        "path": "[relative_base_path]/{filename|slugify}.[ext]"
      }
    }
  }
}
Examples:

In this example, we have configured extra data placeholders to generate a filename from date and title fields for use in the create path.

Copied to clipboard
collections_config:
  blog:
    create:
      extra_data:
        filename: '{date|year}-{date|month}-{date|day}-{title}'
      path: '[relative_base_path]/{filename|slugify}.[ext]'
{
  "collections_config": {
    "blog": {
      "create": {
        "extra_data": {
          "filename": "{date|year}-{date|month}-{date|day}-{title}"
        },
        "path": "[relative_base_path]/{filename|slugify}.[ext]"
      }
    }
  }
}
Open in a new tab