Multi image dialog - store items/images with image resource type | Community
Skip to main content
Level 4
December 5, 2021
Solved

Multi image dialog - store items/images with image resource type

  • December 5, 2021
  • 2 replies
  • 1830 views

hello all,

 

I'm building multi image dialog, everything works fine except that when the dialog item (with image and some text) is stored I would like the item/s to be stored as sling:resourceType of core image so that in the HTL I can use something like, 

data-sly-resource="${ item @ resourceType = 'core/wcm/components/image/v2/image' } so that I can leverage responsive features of image component.

 

Currently I'm rendering image as, for which I'm not sure is a proper way and is this going to work on publishing server ?

<img src="${item.fileReference}"/>

 

Component dialog

 

 

dialog structure in crx

 

 

Content item upon Author uploads image to dialog. 

 

 

This is where (item1, item2, etc...) I would like to have one more property, sling:resourceType of core image .

 

 

Thank you

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by nbg62

Solution was to add hidden field for resourceType in the dialog

 

 

2 replies

Level 2
December 6, 2021

 ..

Nikhil-Kumar
Community Advisor
Community Advisor
December 6, 2021

@urosk  - As this is a multifield of image, so it will hold data in different node (like item0, item1,..) . Just check for resourceType in the parent node i.e items.

nbg62AuthorAccepted solution
Level 4
December 6, 2021

Solution was to add hidden field for resourceType in the dialog