How to Access Image Rendition in AEM

故事扮演 提交于 2019-12-12 06:30:26

问题


we have different renditions of image created in dam by Dam Workflow in our project. Now when we want to access an image in page how will we know which rendition to access dynamically depending on the device. Is it something which UI decides or is it something AEM decides. And how does it work with dispatcher.

Any help is highly appreciated. Thanks, Tushar


回答1:


You can build logic into your components so that they will fetch the correct image, so the UI decides which image rendition to fetch. You can use something like the picture element or something like the picturefill polyfill to do this. These elements allow you to define the screen resolution min and max and

"the browser will only download the image explicitly stated for the matching scenario."

You can build the different "srcset" attributes to reference your different rendition URLs. Since each rendition has a different url, each will get dispatcher cached separately.

Also check out image presets.



来源:https://stackoverflow.com/questions/40153767/how-to-access-image-rendition-in-aem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!