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

paths

Table of contents

Description:

This key defines paths for your Rich Text editors or File inputs.

If undefined at higher levels of the configuration cascade, paths will default to any values configured in the CloudCannon configuration file.

Appears in:
├── _inputs
│   └── *
│       ├── Rich Text Input
│       │   └── options
│       │       └── paths
│       ├── File Input
│       │   └── options
│       │       └── paths
│       └── URL Input
│           └── options
│               └── paths
└── _editables
    ├── content
    │   └── paths
    ├── block
    │   └── paths
    ├── link
    │   └── paths
    ├── image
    │   └── paths
    └── text
        └── paths
Type:
Object
Properties:

This key defines the path for the location of statically copied assets for DAM files.

Show examplesHide examples

In this example, we have configured the DAM static path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      dam_static: /assets/dam/
{
  "collections_config": {
    "blog": {
      "paths": {
        "dam_static": "/assets/dam/"
      }
    }
  }
}

This key defines the path for the default location of newly uploaded DAM files.

You can use dynamic placeholders for uploads and dam_uploads.

Show examplesHide examples

In this example, we have configured the DAM uploads path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      dam_uploads: /dam/uploads/blog/
{
  "collections_config": {
    "blog": {
      "paths": {
        "dam_uploads": "/dam/uploads/blog/"
      }
    }
  }
}

This key defines the path for the name of the uploaded file, when uploading DAM files.

Show examplesHide examples

In this example, we have configured the DAM uploads filename path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      dam_uploads_filename: '{filename|slugify}'
{
  "collections_config": {
    "blog": {
      "paths": {
        "dam_uploads_filename": "{filename|slugify}"
      }
    }
  }
}
staticstring#

This key defines the path for the location of statically copied assets.

Show examplesHide examples

In this example, we have configured the static path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      static: /assets/
{
  "collections_config": {
    "blog": {
      "paths": {
        "static": "/assets/"
      }
    }
  }
}
uploadsstring#

This key defines the paths for the default location of newly uploaded site files.

You can use dynamic placeholders for uploads and dam_uploads.

Defaults to: uploads

Show examplesHide examples

In this example, we have configured the uploads path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      uploads: /uploads/blog/
{
  "collections_config": {
    "blog": {
      "paths": {
        "uploads": "/uploads/blog/"
      }
    }
  }
}

This key defines the path for the name of the uploaded file.

Show examplesHide examples

In this example, we have configured the uploads filename path for the blog Collection.

Copied to clipboard
collections_config:
  blog:
    paths:
      uploads_filename: '{filename|slugify}'
{
  "collections_config": {
    "blog": {
      "paths": {
        "uploads_filename": "{filename|slugify}"
      }
    }
  }
}

This key toggles whether CloudCannon will use relative paths instead of absolute paths for uploaded files.

Setting this key to true will make CloudCannon use relative paths for uploaded files, which are relative to the file being edited rather than the repository root.

Defaults to: false

Show examplesHide examples

In this example, we have configured uploads to use relative paths for files uploaded in the Content Editor.

Copied to clipboard
_editables:
  content:
    paths:
      uploads_use_relative_path: true
{
  "_editables": {
    "content": {
      "paths": {
        "uploads_use_relative_path": true
      }
    }
  }
}
Examples:

In this example, we have configured paths for the blog Collection to set custom upload and static paths.

Copied to clipboard
collections_config:
  blog:
    paths:
      uploads: /uploads/blog/
      static: /assets/
{
  "collections_config": {
    "blog": {
      "paths": {
        "uploads": "/uploads/blog/",
        "static": "/assets/"
      }
    }
  }
}
Open in a new tab