Skip to content

Commit

Permalink
set path/alt.text independently of DAM asset
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jan 23, 2024
1 parent ea74409 commit 6111a71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ private void activate() {
private void initPropertiesFromDamAsset(ValueMap properties) {
Asset asset = media.getAsset();
if (asset != null) {
fileReference = asset.getPath();
alt = asset.getAltText();

com.day.cq.dam.api.Asset damAsset = asset.adaptTo(com.day.cq.dam.api.Asset.class);
if (damAsset != null) {
boolean titleFromAsset = properties.get(PN_TITLE_VALUE_FROM_DAM, currentStyle.get(PN_TITLE_VALUE_FROM_DAM, true));
boolean uuidDisabled = currentStyle.get(PN_UUID_DISABLED, false);

fileReference = damAsset.getPath();
alt = asset.getAltText();

if (!uuidDisabled) {
uuid = damAsset.getID();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
data-cmp-is="wcmio-responsiveimage"
data-asset="${image.fileReference}"
data-asset-id="${image.uuid}"
data-cmp-filereference="${image.fileReference}"
data-title="${image.title || image.alt}"
id="${image.id}"
data-cmp-data-layer="${image.data.json}"
Expand Down

0 comments on commit 6111a71

Please sign in to comment.