Fetch the background Image from the dialog

Avatar

Avatar

maryanilak48011

Avatar

maryanilak48011

maryanilak48011

24-09-2020

 I need to add a background image field in the dialog so that it would be the background image for the component. How do I fetch it?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jineet_Vora

Avatar

Jineet_Vora

Jineet_Vora

24-09-2020

Hello @maryanilak48011,

Please consider below dialog structure:

<imgPath
  jcr:primaryType="nt:unstructured"                                      
  sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"  
  fieldDescription="Select an image from path browser"
  fieldLabel="Browse Image"
  name="./imagePath" >
</imgPath>

Once the value is stored in dialog then you can fetch in HTL using:
${properties.imagePath} which will give the path of the selected image.

Hope this helps!

Jineet

Answers (0)