How to have more than one image in the authoring dialog? | Adobe Higher Education
Skip to main content
Level 2
October 19, 2023
해결됨

How to have more than one image in the authoring dialog?

  • October 19, 2023
  • 2 답변들
  • 604 조회

So I have a generic image component that is used by other components whenever they want to render images. I'm trying to update it to support remote images, so it has a data-sly-use.image="com.adobe.cq.wcm.core.components.models.Image", and the image's src is set to image.src so that it works with remote images. The issue that I'm dealing with is when there's more than one image in an authoring dialog.

 

The way I would deal with this for local images was having a different name for the fileReferenceParameter field, but I'm not sure how to get around that for remote images. For some reason, image.src references the latest uploaded image so there doesn't seem to be a way to differentiate between all the images. 

이 주제는 답변이 닫혔습니다.
최고의 답변: EstebanBustamante

I think the easiest way to handle this situation would be to avoid updating the dialog. Instead, consider using two images. You might want to use a "wrapper" component where you can add multiple image components. This way, you won't have to update anything in the image component. Some examples of this pattern include the carousel and tabs components from the core components.

 

I hope this helps.

2 답변

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 24, 2023

I think the easiest way to handle this situation would be to avoid updating the dialog. Instead, consider using two images. You might want to use a "wrapper" component where you can add multiple image components. This way, you won't have to update anything in the image component. Some examples of this pattern include the carousel and tabs components from the core components.

 

I hope this helps.

Esteban Bustamante
kautuk_sahni
Community Manager
Community Manager
October 26, 2023

@ishaja Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni