Solved
Incorporate Image editorial component inside another component
Hello everyone,
I am trying to incorporate the editorial Image component inside mine (advancedbanner), but I cannot seem to make it work.
I want to be able to configure the image component from inside the dialog of the advanced banner without initiating a new component outside of the content tree.
I need the image component so that the src url is dynamic and it's not a static url that is coming from the DAM (which makes the image file size very big).
This is what I've done so far:
Inside advancedbanner.html I have this:
<div class="cmp-advancedbanner__image">
<sly data-sly-resource="${ 'file' @ resourceType='b2c-website-foundation/components/image', alt=properties.bannerImgAltText }"/>
</div>
and inside the cq_dialog xml I have this:
and inside the cq_dialog xml I have this:
<file
jcr:primaryType="nt:unstructured"
jcr:title="Asset"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
fieldLabel="Advanced Banner Image"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
mimeTypes="[image]"
multiple="{Boolean}false"
allowUpload="{Boolean}true"
autoStart="{Boolean}true"
uploadUrl="/bin/wcm/upload"
name="./file"/>
With this it just creates a new image component outside of the content tree that needs configuring again (uploading an image), instead of being able to upload it from the advanced banner's dialog.
How can I achieve this?
With this it just creates a new image component outside of the content tree that needs configuring again (uploading an image), instead of being able to upload it from the advanced banner's dialog.
How can I achieve this?