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

editor_key

Table of contents

Description:

This key defines the key that a user in CloudCannon will see to edit this value.

The value returned by this parser is a number input that can be edited to change how many literals are output by the parser.

Appears in:
└── Snippet
    └── params
        └── *
            └── Content Parser Configuration
                └── options
                    └── editor_key
Type:
string
Examples:
Copied to clipboard
_snippets:
  custom_title:
    snippet: '[[hashes]] [[title]]'
    params:
      hashes:
        parser: repeating_literal
        options:
          literal: '#'
          minimum: 1
          editor_key: heading_level
      title:
        parser: content
        options:
          editor_key: title
          forbidden_tokens:
            - |+
{
  "_snippets": {
    "custom_title": {
      "snippet": "[[hashes]] [[title]]",
      "params": {
        "hashes": {
          "parser": "repeating_literal",
          "options": {
            "literal": "#",
            "minimum": 1,
            "editor_key": "heading_level"
          }
        },
        "title": {
          "parser": "content",
          "options": {
            "editor_key": "title",
            "forbidden_tokens": [
              "\n"
            ]
          }
        }
      }
    }
  }
}

Example usage:

Markdown
Copied to clipboard
# My blog post 

Aenean lacinia bibendum nulla sed consectetur.

## My heading 

Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

If editing these as snippets in CloudCannon, the editor will see heading_level as a number input. Changing this value will add or remove # characters to the source code to match the number.

Open in a new tab