Recent searches

in

Configure Text Editable Regions

Last modified: October 14th, 2026

On this page

Permissions required

Members of the Owners, Developers, Technical Editors, and Partner Default Permission Groups, or Custom Permission Groups with the site:source-editor:write permission, can add Editable Regions to files using the Source Editor in CloudCannon.

Text Editable Regions are one type of Editable Region you can add to your layout and HTML-like files to enable visual editing. Text Editable Regions allow you to edit text values stored in front matter, data files, or the content of your files, with plain text or rich text formatting options.

To avoid misconfiguration issues where CloudCannon cannot find the data property you want to edit, always add Editable Regions to values closest to the root of the file first (i.e., work from parent elements towards child elements).

These instructions assume you have configured your build settings and are comfortable editing HTML layouts, either in CloudCannon's Source Editor or your local development environment.

To configure Text Editable Regions in the Visual Editor:

  1. Identify the file to which you want to add a Text Editable Region. We recommend any layout files that contain templating that is populated by content files at build time.
  2. Open the file in CloudCannon's Source Editor or your local development environment.
  3. Identify the HTML tag that contains your templating and add the HTML attribute data-editable="text". If no DOM element is available, you can wrap the templating in the <editable-text> web component.
  4. Add the data-prop="" HTML attribute to the same DOM element, or to the <editable-text> web component. The value of data-prop should be the path to the data property you want to edit.
  5. Save your changes and rebuild your Site.

When you open the file in the Visual Editor, CloudCannon will show a yellow Editable Region box around the text field. If your text field contains rich text, CloudCannon will show a WYSIWYG toolbar for formatting your content when you click into the Editable Region.

A screenshot of the Visual Editor shows a yellow Editable Region box around the blog content and a WYSIWYG toolbar.

Want to make a standalone HTML-like file visually editable?

We recommend configuring Source Editable Regions for standalone HTML-like files with hard-coded content (e.g., .astro or .liquid pages) rather than several Text and Image Editable Regions. When a Source Editable Region uses block formatting, you can edit images inside it in the rich text editor.

Examples#

Here are a few examples of different Text Editable Regions:

ASTRO
Copied to clipboard
<h1 data-editable="text" data-prop="title" >{title}</h1> 

The data-editable attribute defines what kind of data this element contains, and the data-prop attribute defines the path to the data we want to edit. In this case, we want a Text Editable Region, so the value of data-editable is text, and we want to edit the title structured data key in the file front matter.

ASTRO
Copied to clipboard
<p>By: <editable-text data-prop="author">{author}</editable-text></p> 

The <editable-text> web component defines what kind of data this element contains, and the data-prop attribute defines the path to the data we want to edit. In this case, we used the web component to wrap the {author} templating specifically, and we want to edit the author structured data key in the file front matter.

ASTRO
Copied to clipboard
<editable-text data-prop="@content"> 
    <slot />
</editable-text>

The <editable-text> web component defines what kind of data this element contains, and the data-prop attribute defines the path to the data we want to edit. In this case, we used the web component to wrap the <slot /> element, which will be populated by Markdown content at build time, and we want to edit the Markdown content of the file, as signified by the special value @content.

WYSIWYG toolbar formatting options#

Depending on whether your Editable Region contains plain text or rich text, CloudCannon may show you a WYSIWYG toolbar with different formatting options. These options are controlled by the data-type HTML attribute. You can manually define this attribute, or rely on CloudCannon's default behavior.

The data-type attribute accepts three values: span for plain text, text for paragraph-level rich text formatting options (e.g., bold, links, superscript), or block for multi-paragraph rich text formatting (e.g., bulleted lists, quote blocks).

When data-type is not defined, CloudCannon uses block or text for any Source Editable Regions, data-prop="@content", or Rich Text Inputs, and span where Input type is not Rich Text, or is not configured.

If you want to specify exactly which formatting tools are available, you can manually define your WYSIWYG toolbar under the _editables key in your CloudCannon Configuration File. For more information, please read our documentation on configuring your rich text editors.

Rich text styles#

Text Editable Regions with data-type="text" or data-type="block" support Rich Text styles, letting your team apply your own CSS classes to selected text from the WYSIWYG toolbar.

Define your styles with the styles option under _editables.text in your CloudCannon Configuration File, or under _inputs.*.options.styles for a Rich Text Input. The value is the path to a CSS file containing the classes you want to make available.

Copied to clipboard
_editables:
  text:
    styles: /css/editor-styles.css
{
  "_editables": {
    "text": {
      "styles": "/css/editor-styles.css"
    }
  }
}

Misconfigured Text Editable Regions#

If your Text Editable Region is misconfigured, CloudCannon will replace it in the Visual Editor with a red Error Card headed Failed to render text editable region, followed by a message describing the problem.

A screenshot of an Error Card in the Visual Editor shows a message headed Failed to render text editable region, with the reason and a hint naming the data-prop value that could not be found.

Text Editable Regions are misconfigured if:

  • You did not define the data-prop HTML attribute.
  • The Editable Region has an invalid data type (e.g., your Text region has a number or object, instead of a string).
  • You have an unsupported value for data-type. It must be span, text, or block.

Related Resources

Open in a new tab