Default Image in dialog for file upload in aem dialog | Community
Skip to main content
Level 2
August 1, 2024
Solved

Default Image in dialog for file upload in aem dialog

  • August 1, 2024
  • 1 reply
  • 873 views

We have a requirement where in we have to show a default image once a dialog is opened. Then we can select the image we need. The image resourcetype is fileupload.  can someone help ?

 

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 TarunKumar

Hi @sirishap9577191 ,

 

Please try to use cq:template. The use case for this property can be if you want to provide the default
values of properties of a component, then it can help you out.
 
 
-Tarun

1 reply

TarunKumar
Community Advisor
TarunKumarCommunity AdvisorAccepted solution
Community Advisor
August 1, 2024

Hi @sirishap9577191 ,

 

Please try to use cq:template. The use case for this property can be if you want to provide the default
values of properties of a component, then it can help you out.
 
 
-Tarun
arunpatidar
Community Advisor
Community Advisor
August 1, 2024

Example structure in CRXDE:

/apps/my-project/components/content/my-component └── cq:template (nt:unstructured) └── fileReference (String) = /content/dam/my-project/default-image.jpg

 

Example dialog.xml:

<image jcr:primaryType="nt:unstructured" sling:resourceType="cq/gui/components/authoring/dialog/fileupload" allowUpload="{Boolean}false" autoStart="{Boolean}false" class="cq-droptarget" fieldDescription="Browse an Image" fieldLabel="Image" fileNameParameter="./fileName" fileReferenceParameter="./fileReference" mimeTypes="[image]" multiple="{Boolean}false" name="./file" title="Upload Image Asset" uploadUrl="${suffix.path}" useHTML5="{Boolean}true"/>

 

Arun Patidar