Legacy Option Flags

Last modified: September 24th, 2025

Image size attributes default behaviour#

Older versions of CloudCannon would automatically add size attributes (width, height, sizes) to the HTML for images uploaded in the Content Editor and Editable Regions. This flag sets this as the default behavior, and will be turned on for some Sites where these attributes must be added to rich text images by default.

In most cases, this flag will be turned off, meaning that the attributes will not be injected for any editing interface that does not have image_size_attributes: true.

We do not recommend turning this flag on. Please consider using the image_size_attributes key instead.

As an alternative to turning this flag on, you can use the image_size_attributes: true configuration option anywhere in the Configuration Cascade for the Content Editor, Rich Text inputs, and Editable Regions. When image_size_attributes is true, CloudCannon will inject width and height attributes onto images added to rich text through the editor.

A benefit of enabling image_size_attributes is that Internet browsers can size <img> elements before loading CSS and images. This prevents "pop-in" where the webpage shifts around in front of the viewer as images are loaded and elements are resized. Additionally, these attributes are required for srcset to work correctly. Browsers assume that the width of an image is 100vw by default. If the image has a srcset but no explicit size attributes, it will appear full-width regardless of the srcset.

One notable disadvantage of image_size_attributes is that, depending on the Markdown engine used by your Site, Markdown-formatted images may need to be converted to HTML.

If adding size attributes to your images is not right for you, some simple CSS can ensure that your images are sized correctly on the page. Define a width for your images, then set height to auto. This will allow the browser to calculate the appropriate height for your image based on the width.

styles.css
copied

img {
  max-width: 100%;
  height: auto;
}

Legacy Collections Value Key#

When you use a select input to reference a collection item, the value saved in your front matter is determined by options.value_key configured for your input. If this option has not been configured, the value will fallback to look for one of several sensible keys to pull from, like "id" and "title".

This flag exists to provide legacy behaviour to sites created before 25 November 2021. If turned on, select inputs that reference collection items, and which do not have options.value_key configured, will save a combination of the collection item's path, slug and id.

It is not recommended to turn this flag on. Instead, configure options.value_key for any select inputs that reference collections on your site.

hide_link_to_telephone is a configuration option that can be set on URL inputs to hide the option to link to a telephone number.

This flag sets the default behaviour, when hide_link_to_telephone is not explicitly configured. If this flag is turned on, the telephone option will be hidden for any URL input that does not explicitly have hide_link_to_telephone configured.

Open in a new tab