6.4.x: How to display image path in component dialog?
I have several components here which uses image (examples: background image in a div or a img tag for displaying images).
I want to:
- display the image/asset path when I open dialog if an image has been imported already
- display blank/empty string if no image has been imported
Any ideas on how to do this? I found something that may work (Image Path in Touch UI dialog (AEM 6.1 and AEM 6.2)
As a test, I placed a console.log("something here") just before $(document) and nothing is showing up in the console.
This is the xml declaration for the property that contains the image path in the node
<file
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
autoStart="{Boolean}false"
class="cq-droptarget"
fieldLabel="Image asset"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./file"
title="Upload Image Asset"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"
allowUpload="{Boolean}false" />
Can you please help? Thanks