- Description:
This key defines input options for image Editable Regions.
- Appears in:
└── _editables └── image- Type:
Object- Properties:
This key defines which sources and DAMs you are allowed to upload to and browse.
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.Appears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.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 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:
falseAppears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.Show 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 defines the height of the bounding box used in the resizing method defined by
resize_style.Appears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.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 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:
trueAppears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.Show 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 defines what format an image is converted to prior to upload.
Allowed values:
image/jpegimage/pngimage/webpAppears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.Show 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 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.Appears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.link,_editables.image,_editables.text.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:
falseAppears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.Show 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 defines how image files are resized prior to upload, using a bounding box defined by
widthandheightoptions (these optionas are required). This key applies to existing images unlessprevent_resize_existing_filesis set. Setting this key tocoverkeeps aspect ratio and ensures the image covers the bounding box,containkeeps aspect ratio and ensures the image fits inside the bounding box,cropprompts the user with an interface to select an aspect-ratio-respecting area, andstretchignores aspect ratio and resizes the image to the bounding box.Defaults to:
containAllowed values:
covercontainstretchcropAppears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.Show 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 defines definitions for creating additional images of different sizes when uploading or selecting existing files.
Appears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.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 defines the width of the bounding box used in the resizing method defined by
resize_style.Appears in: Rich Text Input
options, URL Inputoptions, File Inputoptions,_editables.content,_editables.block,_editables.image.- Examples: