The Core Component Image Component is an adaptive image component features in-place editing.
The Image Component allows easy placement of image assets and offers in-place editing. It features adaptive image selection with lazy loading as well as cropping for the content author.
The allowed image widths as well as cropping and additional settings can be defined by the template author in the design dialog. The content editor can upload or select assets in the configure dialog and crop the image in the edit dialog. For added convenience, simple in-place modification of the image is also available.
This document describes v1 of the Image Component, originally introduced with release 1.0.0 of the Core Components with AEM 6.3.
The following table lists the compatibility of v1 of the Image Component.
AEM Version | Image Component v1 |
---|---|
6.3 | Compatible |
6.4 | Compatible |
This document describes v1 of the Image Component.
For details of the current version of the Image Component, see the Image Component document.
The following is sample taken from We.Retail.
<div class="cmp cmp-image aem-GridColumn aem-GridColumn--default--12">
<noscript data-cmp-image="{"smartImages":[],"smartSizes":[],"lazyEnabled":true}">
<img src="/content/we-retail/us/en/equipment/_jcr_content/root/responsivegrid/image.img.jpg" alt="Surfboard"/>
</noscript>
</div>
"image": {
"columnClassNames": "aem-GridColumn aem-GridColumn--default--12",
"smartSizes": [],
"smartImages": [],
"lazyEnabled": true,
"src": "/content/we-retail/us/en/equipment/equipment/jcr%3acontent/root/responsivegrid/image.img.jpeg",
":type": "weretail/components/content/image"
}
JSON export from the Core Components requires release 1.1.0 of the Core Components. Please see the compatibility information for Core Components v1 for more information.
In addition to the standard edit dialog and design dialog, the image component offers a configure dialog where the image itself is defined along with its description and basic properties.
Image asset
Image is decorative - Check if the image should be ignored by assistive technology and therefore does not require an alternative text. This applies to decorative images only.
Alternative text - Textual alternative of the meaning or function of the image, for visually impaired readers.
Link
Caption - Additional information about the image, displayed below the image be default.
Display caption as pop-up - When checked, the caption won’t be displayed below the image, but as a pop-up displayed by some browsers when hovering over the image.
The edit dialog allows the content author to crop, modify the launch map, and zoom the image.
Start Crop
Selecting this option opens a drop-down for pre-defined crop proportions.
Once a crop option is selected, use the blue handles to size the crop on the image.
Rotate Right
Use this option to rotate the image 90° to the right (clockwise).
Launch Map
Use this option to apply a launch map to the image. Selecting this option opens a new window allowing the user select the shape of the map:
Add Rectangular Map
Add Circular Map
Add Polygon Map
Once a map shape is selected, it is superimposed on the image allowing for resizing. Drag and drop the blue resize handles to adjust the shape.
After sizing the launch map, click on it to open a floating toolbar to define the path of the link.
Use the Path Picker option to select a path in AEM
If the path is not in AEM, use the absolute URL. Non-absolute paths will be interpreted relative to AEM.
Alt text
Alternative description of the path destination
Target
Tap or click the blue check mark to save, the black x to cancel, and the red trash can to delete the map.
Reset Zoom
If the image has already been zoomed, use this option to reset the zoom level.
Open Zoom Slider
Use this option to display a slider to control the zoom level of the image.
The in-place editor can also be used to modify the image. Due to space limitations, only basic options are available in-line. For full edit options, use the full-screen mode.
Image edit operations (crop, flip, rotate) are not supported for GIF images. Any such changes made in edit mode to GIFs will not be persisted.
The design dialog allows the template author to define the cropping, upload, and rotation uploads the content author has when using this component.
On the Main tab you can define a list of allowed widths in pixels for the image to automatically load the most appropriate width from the list.
Tap or click the Add button to add another size.
By default images loading is deferred until they become visible. Select the option Disable lazy loading to load the images upon page load.
On the Features tab you can define which options are available to the content authors when using the component including upload options, orientation, and cropping options.
Enable Web Optimized Images - when checked, the web-optimized image delivery service will deliver images in the WebP format, reducing image sizes on average by 25%.
Source
Select the option Allow asset upload from file system to allow content authors to upload images from his or her local computer. To force content authors to only select assets from AEM, de-select this option.
Orientation
The Flip option is disabled by default. Enabling it will display the Flip Vertically and Flip Horizontally buttons in the edit dialog of the image component, however the feature is not currently supported by AEM and any changes made using these options will not be persisted.
Cropping
Select the option Allow crop to allow the content author to crop the image in the component in the edit dialog.
Note that in AEM, crop aspect ratios are defined as height/width. This differs from the conventional definition of width/height and is done for legacy compatibility reasons. The content authors will not be aware of any difference as long as you provide a clear name of the ratio since the name is shown in the UI and not the ratio itself.
The latest technical documentation about the Image Component can be found on GitHub.
The entire core components project can be downloaded from GitHub.
Further details about developing Core Components can be found in the Core Components developer documentation.