dynamic media - aem

Avatar

Avatar

sathya_prakasha

Avatar

sathya_prakasha

sathya_prakasha

29-01-2021

Hi Team,

 

I am able to get the responsive image on my custom component by using responsive . It working for img tag.

 

https://experienceleague.adobe.com/docs/dynamic-media-developer-resources/image-serving-api/image-se...

 

But its not working for background-image:url div class. any suggestions?

<div class="hero__image" style="background-image:url('${dynamicmedia.fileReference @ context='styleString'}')"></div>

aem cloud

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

khamat_bn

Avatar

khamat_bn

khamat_bn

30-01-2021

Hi @sathya_prakasha 

 

as you are referring Dynamic Media Image so please try 'uri' instead of 'styleString' in context. 

 

<div class="hero__image" style="background-image:url('${dynamicmedia.fileReference @ context='uri'}')"></div>

 

 

Answers (0)