Recent searches

in

Configure your rich text editors

Last modified: November 26th, 2026

On this page

You can configure your rich text editors to control which text and image formatting tools are available in the WYSIWYG toolbar, the upload paths or filenames for any assets uploaded through an editor, and how CloudCannon should handle custom markup.

Keyboard shortcuts follow the same options as the WYSIWYG toolbar. A shortcut only applies formatting that the toolbar offers, so if you set bold to false, pressing Cmd+B (or Ctrl+B on Windows and Linux) does nothing.

Keyboard shortcuts can also change the format of a paragraph without opening the Format dropdown in the toolbar:

  • On macOS, Option+Cmd+1 to Option+Cmd+6 change the paragraph to a heading of that level, and Option+Cmd+0 changes it to normal text.
  • On Windows and Linux, the same shortcuts use Ctrl+Shift instead of Option+Cmd.

Each of these shortcuts only works when the Format dropdown offers that format, which you set with the format key. For example, with format: p h2 h3, Option+Cmd+2, Option+Cmd+3, and Option+Cmd+0 work, but Option+Cmd+1 does nothing. Hovering over an option in the Format dropdown shows its shortcut.

There are multiple ways to configure your rich text editors, depending on which editor you want to configure: the Content Editor, Editable Regions in the Visual Editor, or Rich Text inputs.

For a complete list of options available for rich text editors, please read our rich text editor reference.

The Content Editor#

To configure your Content Editor:

  1. Navigate to your global Configuration File.
  2. Open the file in the Source Editor. CloudCannon will show the file contents for you to edit.
  3. Identify the _editables key, or create one at the top level of your Configuration File.
  4. Add the content key under _editables.
  5. Add any keys you want to configure under the content key.
  6. Save your changes to the global Configuration File.

CloudCannon will offer the controls you enabled in the WYSIWYG toolbar the next time you open a file in the Content Editor.

For example, to let Organization Members apply bold, italic, and underline formatting in the Content Editor, your global Configuration File would look like this:

Copied to clipboard
_editables:
  content:
    bold: true
    italic: true
    underline: true
{
  "_editables": {
    "content": {
      "bold": true,
      "italic": true,
      "underline": true
    }
  }
}

Configure the Content Editor and all Editable Regions under the _editables key anywhere in the configuration cascade.

Configuration options for the Content Editor are nested keys under content. As soon as you define one key, CloudCannon will interpret any omitted keys as false and disable those options.

Rich Text inputs#

To configure your Rich Text inputs:

  1. Navigate to your global Configuration File.
  2. Open the file in the Source Editor. CloudCannon will show the file contents for you to edit.
  3. Identify the _inputs key, or create one at the top level of your Configuration File.
  4. Enter the key name for your input under the _inputs key.
  5. Add the options key under your input name.
  6. Add any keys you want to configure under the options key.
  7. Save your changes to the global Configuration File.

CloudCannon will offer the controls you enabled in the WYSIWYG toolbar the next time you open a file containing that input.

Copied to clipboard
_inputs:
  example:
    type: html
    options:
      bold: true
      italic: true
      underline: true
{
  "_inputs": {
    "example": {
      "type": "html",
      "options": {
        "bold": true,
        "italic": true,
        "underline": true
      }
    }
  }
}

Configure a Rich Text input under the _inputs key anywhere in the configuration cascade.

Enter the key name of the input here. In this example, the input name is example.

This input is an HTML Rich Text input. For more information, please read our documentation on Rich Text inputs.

Configuration options for the Rich Text inputs are nested keys under options.

Editable Regions#

The _editables key configures Editable Regions as well as the Content Editor. CloudCannon chooses which key applies from the HTML element your region sits on:

  • text — paragraphs, headings, blockquotes, and list items: <p>, <h1> through <h6>, <blockquote>, <li>, <dd>, and <dt>
  • block — sectioning elements: <div>, <section>, <article>, <aside>, <main>, <header>, <footer>, and <nav>
  • link — <a> elements
  • image — <img> elements
  • span — inline elements: <span>, <small>, <strong>, <em>, <i>, <b>, <sub>, <sup>, <td>, <th>, and <cite>. There is no _editables.span key to configure them.

CloudCannon uses the element on every class="editable" region. On a Text Editable Region defined with data-editable, the element only decides the key when the region edits a Markdown or HTML input. Otherwise, CloudCannon treats the region as span.

A Text Editable Region can override that lookup with the data-type attribute, which accepts span, text, or block. A region with data-type="block" takes its configuration from _editables.block whichever element it sits on. For more information, please read our documentation on configuring Text Editable Regions.

To configure your Editable Regions:

  1. Navigate to your global Configuration File.
  2. Open the file in the Source Editor. CloudCannon will show the file contents for you to edit.
  3. Identify the _editables key, or create one at the top level of your Configuration File.
  4. Add the key for the type of Editable Region under _editables (i.e., text, block, link, or image⁠).
  5. Add any keys you want to configure under the Editable Region key.
  6. Save your changes to the global Configuration File.

CloudCannon will offer the controls you enabled in the WYSIWYG toolbar the next time you open a file in the Visual Editor.

Copied to clipboard
_editables:
  text:
    bold: true
    italic: true
    underline: true
  block:
    format: p h3
    undo: true
    redo: true
  link:
    paths:
      uploads: assets/links
  image:
    mime_type: image/png
    allowed_sources:
      - site-files
{
  "_editables": {
    "text": {
      "bold": true,
      "italic": true,
      "underline": true
    },
    "block": {
      "format": "p h3",
      "undo": true,
      "redo": true
    },
    "link": {
      "paths": {
        "uploads": "assets/links"
      }
    },
    "image": {
      "mime_type": "image/png",
      "allowed_sources": [
        "site-files"
      ]
    }
  }
}

Configure the Content Editor and all Editable Regions under the _editables key anywhere in the configuration cascade.

Configuration options for text Editable Regions are nested keys under text.

Configuration options for block Editable Regions are nested keys under block.

Configuration options for link Editable Regions are nested keys under link. Link Editable Regions take upload paths only, not formatting controls.

Configuration options for image Editable Regions are nested keys under image.

On a class="editable" region, you can configure options directly on the element with a JSON value in the data-cms-options attribute instead. Editable Regions defined with data-editable attributes do not read data-cms-options, and take their configuration from _editables.

HTML
Copied to clipboard
<p class="editable" data-cms-options='{ "bold": true, "italic": true, "underline": true}'>
  ...
</p>

Text styles#

The styles key adds a Styles dropdown to the WYSIWYG toolbar, offering your Organization Members a named style for each rule in a CSS file you nominate. A style is the combination of an element and a class name, so a rule such as p.lead becomes an option your Organization Members can apply to a paragraph. CloudCannon only reads rules in this element.class form, with one class name and no other selectors. Set the value to the path of the CSS file, either in your source files or in your build output.

styles is available on the Content Editor, on text and block Editable Regions, and on Rich Text inputs.

A screenshot of the WYSIWYG toolbar in the Content Editor shows a Styles dropdown beside the Format dropdown and the bold, italic, and underline controls.
The Styles dropdown in the WYSIWYG toolbar
Copied to clipboard
_editables:
  content:
    styles: /css/editor.css
  text:
    styles: /css/editor.css
_inputs:
  example:
    type: html
    options:
      styles: /css/editor.css
{
  "_editables": {
    "content": {
      "styles": "/css/editor.css"
    },
    "text": {
      "styles": "/css/editor.css"
    }
  },
  "_inputs": {
    "example": {
      "type": "html",
      "options": {
        "styles": "/css/editor.css"
      }
    }
  }
}

Adds the Styles dropdown to the Content Editor.

Adds the Styles dropdown to text Editable Regions. A Text Editable Region uses this key when it sits on a <p>, a heading, a <blockquote>, or a list item, or when it sets data-type="text".

Adds the Styles dropdown to this Rich Text input. Rich Text inputs only use their own options. An Editable Region that edits this input uses these options instead of the matching _editables key.

The configuration reference does not list styles under _editables.text.

CloudCannon reads the key and the Styles dropdown appears, but the published configuration schema declares styles only for _editables.content and _editables.block. Your code editor may flag _editables.text.styles as an unrecognized key.

Text alignment#

Text alignment controls are available in the Content Editor, block Editable Regions, and Rich Text inputs. To enable them, add the align key to your rich text editor configuration and set each alignment you want to offer to true.

CloudCannon saves alignment as a text-align style on the block of text (e.g., <p style="text-align: center;">⁠). Use the default key to name the alignment your CSS already applies. Selecting the default alignment in the WYSIWYG toolbar removes any existing alignment from the block rather than saving a style for it.

A screenshot of the WYSIWYG toolbar in the Content Editor shows the Align text dropdown open, offering left, center, right, and justify alignment, with left selected as the default.
The Align text dropdown in the WYSIWYG toolbar
Copied to clipboard
_editables:
  content:
    align:
      default: left
      left: true
      center: true
      right: true
      justify: false
{
  "_editables": {
    "content": {
      "align": {
        "default": "left",
        "left": true,
        "center": true,
        "right": true,
        "justify": false
      }
    }
  }
}

The align key enables the Align text dropdown in the WYSIWYG toolbar.

Text on this Site is already left-aligned by its CSS, so selecting Left align clears the alignment instead of saving text-align: left.

Alignments set to false or omitted are not available in the toolbar.

If your Site aligns text with class names rather than inline styles, add them under the classes key. CloudCannon will toggle the class name for each alignment instead of saving a text-align style. Any alignment without a class name falls back to the text-align style. Define the class names in the CSS file you set with the styles key so that the alignment is visible in the editor.

Copied to clipboard
_editables:
  content:
    styles: /css/editor.css
    align:
      default: left
      left: true
      center: true
      right: true
      classes:
        left: align-left
        center: align-center
        right: align-right
{
  "_editables": {
    "content": {
      "styles": "/css/editor.css",
      "align": {
        "default": "left",
        "left": true,
        "center": true,
        "right": true,
        "classes": {
          "left": "align-left",
          "center": "align-center",
          "right": "align-right"
        }
      }
    }
  }
}
CSS
Copied to clipboard
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

In Markdown Rich Text inputs, CloudCannon saves aligned blocks as HTML unless your Markdown engine has attributes: true. With attributes enabled, CloudCannon saves alignment as a Markdown attribute (e.g., {style="text-align: center;"} or {.align-center}⁠). Kramdown writes these attributes as {: …} instead. For more information, please read our documentation on configuring your Markdown engine.

The align key replaces the deprecated left, center, right, and justify keys, which each took a class name. Existing configuration using those keys continues to work. To migrate, move each class name under align.classes, set the matching alignment to true, and set default to left.

Related Resources

Open in a new tab