내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

New Use case? Adaptive image component defined in the Template but image reference is authored in a content fragment

Avatar

Level 2

We are building an Article page using HTL components. The content for these pages are being authored in a Content Fragment.

 

We have a ‘Hero’ component that has a mixture of text and an image.

 

We want the image to be adaptive using the ‘srcset’ attribute and so after reading the docs for the core Image component we overlayed it.

Sure enough we now have the ability to define the rendition sizes for device widths using Template policies. Good stuff.

 

Now, unless I’m reading it wrong the logic inside both core Image model v3 and AdaptiveImageServlet specify that if the component is part of a Template's structure (which it is) then it expects to use property “fileReference” from that component in order to reference the image asset.

 

However, we are building that page using components that are reading from a Content Fragment including which image to display.

 

Can anyone think of a solution?

 

Much appreciated.

 

Rick

 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

Hello @Rick_Holdsworth 

 

The responsiveness can be achieved by delegating image rendering to the Image Component.

 

This is following in multiple WCM core components like Teaser. You can refer to following link for using Teaser as a reference.

https://github.com/adobe/aem-core-wcm-components/tree/main/content/src/content/jcr_root/apps/core/wc...

A similar implementation with explanation is also available on https://kiransg.com/tag/responsive-image/


Aanchal Sikka

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Administrator

Avatar

정확한 답변 작성자:
Community Advisor

Hello @Rick_Holdsworth 

 

The responsiveness can be achieved by delegating image rendering to the Image Component.

 

This is following in multiple WCM core components like Teaser. You can refer to following link for using Teaser as a reference.

https://github.com/adobe/aem-core-wcm-components/tree/main/content/src/content/jcr_root/apps/core/wc...

A similar implementation with explanation is also available on https://kiransg.com/tag/responsive-image/


Aanchal Sikka