Handle image updates in scripts/editor-support.js
Import decorateLinkedPictures from scripts.js:
In applyChanges(), call decorateLinkedPictures on the updated content before decorating it.
- Block branch: Call
decorateLinkedPictures(newBlock)beforedecorateButtons(newBlock). - Section branch: Call
decorateLinkedPictures(newSection)beforedecorateButtons(newSection). - Default-content branch: Call
newElements.forEach((el) => decorateLinkedPictures(el))beforeelement.replaceWith(...newElements).
Preserve AEM Assets delivery URLs
Blocks that pass images through createOptimizedPicture must skip images served from another origin. The site cannot resize AEM Assets delivery-tier URLs.
For example, in blocks/cards/cards.js, update the image processing code as follows:
Apply the same origin check to any custom block that calls createOptimizedPicture on authored images.
Use Coworker to find and replace images
Now that you have completed the required steps, content authors can use Coworker in the Universal Editor side panel to find and replace an image in a selected component.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an event