-
Notifications
You must be signed in to change notification settings - Fork 42
Add selection options for DynamicMedia SmartCrops #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
blocks/edit/da-assets/da-assets.js
Outdated
if (dmDeliveryEnabled && activationTarget !== 'delivery' && reviewStatus !== 'approved') { | ||
assetSelectorWrapper.style.display = 'none'; | ||
cropSelectorWrapper.style.display = 'block'; | ||
cropSelectorWrapper.innerHTML = '<p class="da-dialog-asset-error">The selected Asset is not available. Please check the activation target and review status.</p><div class="da-dialog-asset-buttons"><button class="back">Back</button><button class="cancel">Cancel</button></div>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be a better message?
The selected asset is not Approved for Delivery. Please choose another asset.
Since regular authors may not know what activation target or review status means.
Tested both the features and both look great! Thank you for this! |
This PR gives more flexibility in using the AssetSelector for adding images to DA.
aem.asset.dm.delivery = 'on'
This option adds DynamicMedia URLs (https://delivery-...) to the DA documents but still use the author (with folder structure) to select via the AssetSelector UI.
aem.asset.smartcrop.select = 'on'
This options enables a selection screen after the AssetSelector UI closes to give the authors a options to choose which DynamicMedia SmartCrop rendition should be added to the document.
responsive-image
sheet in configOn this sheet administrators can define a set of crops which should be added together as a set to the document. It is also aware of the current selection (see
position
) and can provide different sets for inside or outside blocks. If the configuration applies the author has in the crop selection view not only the option to add a single image but choose from predefined sets like adding variant 1-1 and 3-4 together.Configuration
| name | position | crops |
| <arbitrary descriptive name> | <everywhere|outside-block|<block name>> | <list of smartcrop ids> |
| default | everywhere | 1:1, 3:4 |
| Hero | hero | 16:9, 4:3, 3:4 |
Additional Features
dam:activationTarget
andreviewStatus
metadata properties are checked before trying to add an image and give the user a reasonable error messageMotivation and Context
In our client project the authors want to have a flexible way to not only choose from DynamicMedia SmartCrops and add them to the document but also see those images directly in the document and having the option to exchange individual crop variants with completely different assets if necessary.
How Has This Been Tested?
I developed the JS by using the browsers dev tools override mechanism, injecting my adjusted da-assets.js and da-assets.css. I could not use a normal local setup as testing requires AEM Asset access which is not possible with the staging IMS for my user.
Screenshots:
Custom Image Profile Setup in AEMaaCS:
Manually Adjusting SmartCops per Asset if necessary
Sample Config in DA
Crop Selection Screen after selecting an Asset via AssetSelector
Types of changes
Checklist:
I was not able to run the test locally and there does not seem to be an existing test for that part of da-live. Please advice how to proceed.