How to load image for mobile , tablet and desktop through custom image rendition ?
I am taking image from the path field now I want to load custom image for mobile, tablet, and desktop through image rendition.
I am taking image from the path field now I want to load custom image for mobile, tablet, and desktop through image rendition.
You can write your logic to get rendition paths in you Model class.
i.e com.adobe.guides.wknd.core.models.BannerImage
alternatively you can use directly use below snippet -
<div data-sly-use.bannerImage="com.adobe.guides.wknd.core.models.BannerImage">
<img src="${bannerImage.imagePath}" srcset="${bannerImage.imagePath}/jcr:content/renditions/cq5dam.thumbnail.319.319.png 1x,${bannerImage.imagePath}/jcr:content/renditions/cq5dam.thumbnail.48.48.png" alt="My Image">
</div>
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.