- Description:
This key defines input options for the Content Editor.
- Appears in:
└── _editables └── content- Type:
Object- Properties:
This key toggles whether CloudCannon will allow you to edit custom markup in rich text editors and explicitly accept the risk of unintentionally deleting elements that cannot be recreated.
Setting this key to
truewill enable editing of custom markup. When usingallow_custom_markupoutside of editable regions, content that uses JavaScript will not be editable for security reasons. These inputs will appear as uneditable snippets.This key defines which sources and DAMs you are allowed to upload to and browse.
The value can be an array of strings. Valid values include
site-filesand the reference key for any DAM connected to your site.If
site-filesis omitted from the array, site files will not be available as an asset source for this input.Show examplesHide examples
In this example, we have configured allowed sources for an Image Input.
Copied to clipboard_inputs: image: type: image options: allowed_sources: - site-files - my-cloudinary-dam{ "_inputs": { "image": { "type": "image", "options": { "allowed_sources": [ "site-files", "my-cloudinary-dam" ] } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to wrap selected blocks of text in a block quote.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to wrap selected blocks of text in a block quote.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to bold selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to bold selected text.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert an unordered list or convert selected text to an unordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert an unordered list or convert selected text to an unordered list.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to center align selected text by toggling a class name for that text block.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to center align selected text. The value is the class name to align the text. The styles for this class must be defined in thestylesfile.This key toggles whether CloudCannon will display tools in your WYSIWYG toolbar to turn selected text into inline code and selected text into a code block.
Setting this key to
truewill enable two tools in your WYSIWYG toolbar to turn selected text into inline code and selected text into a code block.Defaults to:
falseThis key toggles whether CloudCannon will display a control in your WYSIWYG toolbar to insert a code block in editable regions.
Setting this key to
truewill enable a control in your WYSIWYG toolbar to insert a code block.By default, this key is
false(i.e., the code block control is not displayed).Defaults to:
falseThis key toggles whether CloudCannon will display a control in your WYSIWYG toolbar to create an inline code element, containing any selected text.
Setting this key to
truewill enable a control in your WYSIWYG toolbar to create an inline code element.By default, this key is
false(i.e., the inline code control is not displayed).Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to copy formatting from selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to copy formatting from selected text. Applies tobold,italic,underline,strike,subscript, andsuperscriptformatting. Does not copy other styles or formatting.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert a region of raw HTML for YouTube, Vimeo, social media posts, or other media.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert a region of raw HTML. Embedded content is sanitized to mitigate XSS risks, which includes removingstyletags. Embeds containingscripttags are not loaded a rich text editor.Defaults to:
falseThis key defines whether you can upscale an image to fit the bounding box while resizing an image prior to upload.
Has no effect if files are not resized.
Defaults to:
falseShow examplesHide examples
In this example, we have configured an Image Input to allow upscaling images to fit the bounding box while resizing.
Copied to clipboard_inputs: hero_image: type: image options: width: 1200 height: 600 resize_style: cover expandable: true{ "_inputs": { "hero_image": { "type": "image", "options": { "width": 1200, "height": 600, "resize_style": "cover", "expandable": true } } } }This key toggles whether CloudCannon will display a dropdown menu tool in your WYSIWYG toolbar for structured text.
Setting this key to
truewill enable a dropdown menu tool in your WYSIWYG toolbar for structured text. Valid values include forp,h1,h2,h3,h4,h5,h6,pre,address, anddiv. Include a space between each values, e.g.format: p h1 h2.Defaults to:
p h1 h2 h3 h4 h5 h6This key defines the height of the bounding box used in the resizing method defined by
resize_style.Show examplesHide examples
In this example, we have configured the height of the bounding box for an Image Input.
Copied to clipboard_inputs: hero_image: type: image options: width: 1200 height: 600 resize_style: cover{ "_inputs": { "hero_image": { "type": "image", "options": { "width": 1200, "height": 600, "resize_style": "cover" } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert a horizontal line.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert a horizontal line.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert an image and enter alternative text and title text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert an image. Select an existing image, upload an image, or use an external link.Defaults to:
trueThis key toggles whether CloudCannon will instruct a rich text editor to save
widthandheightattributes on image elements.Setting this key to
truewill instruct the rich text editor to savewidthandheightattributes on image elements. This can prevent pop-in as a page loads.By default, this key is
false(i.e., width and height attributes are not saved on image elements). This defaults totrueif the Image Size Attributes site flag is enabled (this is enabled for sites created before June 23 2023, in order to keep those sites working).Defaults to:
trueShow examplesHide examples
In this example, CloudCannon will save width and height attributes on image elements in a Rich Text Input.
Copied to clipboard_inputs: content: type: markdown options: image_size_attributes: true{ "_inputs": { "content": { "type": "markdown", "options": { "image_size_attributes": true } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to increase the indentation of a list item in an ordered or unordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to increase the indentation of a list item.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to italicize selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to italicize selected text.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to merge a list item with the item above it in an ordered or unordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to merge a list item with the item above it.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to merge a list item with the item below it in an ordered or unordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to merge a list item with the item below it.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to justify selected text by toggling a class name for that text block.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to justify selected text. The value is the class name to align the text. The styles for this class must be defined in thestylesfile.This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to left align selected text by toggling a class name for that text block.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to left align selected text. The value is the class name to align the text. The styles for this class must be defined in thestylesfile.This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to create a hyperlink around selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to create a hyperlink around selected text.Defaults to:
trueThis key defines what format an image is converted to prior to upload.
Allowed values:
image/jpegimage/pngimage/webpShow examplesHide examples
In this example, we have configured an Image Input to convert images to WebP format prior to upload.
Copied to clipboard_inputs: hero_image: type: image options: mime_type: image/webp{ "_inputs": { "hero_image": { "type": "image", "options": { "mime_type": "image/webp" } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert an ordered list or convert selected text to an ordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert an ordered list or convert selected text to an ordered list.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to decrease the indentation of a list item in an ordered or unordered list.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to decrease the indentation of a list item.Defaults to:
falseThis key defines paths for your Rich Text editors or File inputs.
If undefined at higher levels of the configuration cascade,
pathswill default to any values configured in the CloudCannon configuration file.Show examplesHide examples
In this example, we have configured paths for the
blogCollection to set custom upload and static paths.Copied to clipboardcollections_config: blog: paths: uploads: /uploads/blog/ static: /assets/{ "collections_config": { "blog": { "paths": { "uploads": "/uploads/blog/", "static": "/assets/" } } } }This key toggles whether CloudCannon will skip the image resizing process configured for this input when selecting existing images.
Setting this key to
truewill skip the image resizing process when selecting existing images.Defaults to:
falseShow examplesHide examples
In this example, CloudCannon will skip the image resizing process when selecting existing images for an Image Input.
Copied to clipboard_inputs: hero_image: type: image options: width: 1200 height: 600 resize_style: cover prevent_resize_existing_files: true{ "_inputs": { "hero_image": { "type": "image", "options": { "width": 1200, "height": 600, "resize_style": "cover", "prevent_resize_existing_files": true } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to redo recent edits undone with
undo.Setting this key to
truewill enable a tool in your WYSIWYG toolbar to redo recent edits. Undo is always enabled through standard OS-specific keyboard shortcuts.Defaults to:
falseThis key toggles whether CloudCannon will allow you to strip custom markup from content edited in a rich text editor, allowing you to clean files of unnecessary HTML content.
Setting this key to
truewill enable stripping custom markup from content. Theremove_custom_markupkey is disabled ifallow_custom_markupis enabled.This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to remove formatting from selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to remove formatting. Applies tobold,italic,underline,strike,subscript, andsuperscriptformatting. Does not remove other styles or formatting.Defaults to:
trueThis key defines how image files are resized prior to upload, using a bounding box defined by
widthandheightoptions.Valid values are
cover,contain,crop, orstretch:coverkeeps aspect ratio and ensures the image covers the bounding boxcontainkeeps aspect ratio and ensures the image fits inside the bounding boxcropprompts the user with and interface to select an aspect-ratio-respecting areastretchignores aspect ratio and resizes the image to the bounding box
This key does not apply to existing images, and does not work if
widthandheightoptions are not defined.Defaults to:
containAllowed values:
covercontainstretchcropShow examplesHide examples
In this example, we have configured an Image Input to resize images using the
coverstyle to ensure images cover the bounding box while maintaining aspect ratio.Copied to clipboard_inputs: hero_image: type: image options: width: 1200 height: 600 resize_style: cover{ "_inputs": { "hero_image": { "type": "image", "options": { "width": 1200, "height": 600, "resize_style": "cover" } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to right align selected text by toggling a class name for that text block.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to right align selected text. The value is the class name to align the text. The styles for this class must be defined in thestylesfile.This key defines definitions for creating additional images of different sizes when uploading or selecting existing files.
Show examplesHide examples
In this example, we have configured an Image Input to create additional images of different sizes when uploading or selecting files.
Copied to clipboard_inputs: hero_image: type: image options: sizes: - size: 2x - size: 3x{ "_inputs": { "hero_image": { "type": "image", "options": { "sizes": [ { "size": "2x" }, { "size": "3x" } ] } } } }This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert a Snippet, if any are available.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert a Snippet.Defaults to:
trueThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to strike through selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to strike through selected text.Defaults to:
falseThis key toggles whether CloudCannon will display a dropdown menu in your WYSIWYG toolbar to apply a style to selected text.
Setting this key to
truewill enable a dropdown menu in your WYSIWYG toolbar to apply a style to selected text. Styles are the combination of an element and class name. The value for this option is the path (either source or build output) for the CSS file containing styles.This key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to subscript selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to subscript selected text.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to superscript selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to superscript selected text.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to insert a table.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to insert a table. Further table options are available from the table context menu in the rich text editor.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to underline selected text.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to underline selected text.Defaults to:
falseThis key toggles whether CloudCannon will display a tool in your WYSIWYG toolbar to undo recent edits.
Setting this key to
truewill enable a tool in your WYSIWYG toolbar to undo recent edits. Undo is always enabled through standard OS-specific keyboard shortcuts.Defaults to:
false- Examples: