Fetch the background Image from the dialog | Community
Skip to main content
maryani
Level 2
September 24, 2020
Solved

Fetch the background Image from the dialog

  • September 24, 2020
  • 1 reply
  • 938 views

 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?

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 Jineet_Vora

Hello @maryani,

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

1 reply

Jineet_Vora
Community Advisor and Adobe Champion
Jineet_VoraCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 24, 2020

Hello @maryani,

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