Expand my Community achievements bar.

Image not saved on image node

Avatar

Level 2

Hi, 

I am using AEM 6.1 and I want to save an image in the page properties of a page. I've created an additional tab and my dialog snippet looks like this:

<image
      jcr:primaryType="nt:unstructured"
      sling:resourceType="granite/ui/components/foundation/form/fileupload"
      autoStart="{Boolean}false"
      class="cq-droptarget"
      fieldLabel="Hero Image"
      fileNameParameter="./image/fileName"
      mimeTypes="[image]"
      multiple="{Boolean}false"
      name="./image/file"
      uploadUrl="${suffix.path}"
      useHTML5="{Boolean}true"/>

I can drag&drop an image from the asset rail and an 'image' node is created underneath the page's 'jcr:content' node but there is no 'fileReference' attribute saved to the 'image' node. 

Is there anything missing? Or am I doing something wrong?

I have the same problem with and without installing Service Pack 1 for 6.1 

Any help is greatly appreciated. Thanks, 

Alex

7 Replies

Avatar

Level 4

Hi,

I am facing the same issue in 6.3

Did you fix it?

Regards,

Manish

Avatar

Level 10

is this happening only with page properties?

Did you tried using same field as part of a component?

Avatar

Level 7

Hi Alex,

From your dialog snippet, we could see that you didn't add  fileReferenceParameter="./fileReference". Try adding fileReferenceParameter in properties as shown in the below screenshot.

filereference.png

You should be able to see it in your jcr:content node now.

We hope this helps!

Regards,

TechAspect Solutions

Avatar

Level 4

I tried adding the property fileReferenceParameter={String}./fileReference.

But i dont see fileReference property in Image node.

I did changes in _cq_dialog of page properties.

Am i missing something?

Avatar

Level 8

Hi,

In case drag and drop is not required and main motive is to have an image, pathbrowser is a nice option

<sample

                                               

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="granite/ui/components/foundation/form/pathbrowser"

                                                fieldLabel="Name"

                                                name="./Name"

                                                rootPath="/content/dam"/>

Avatar

Level 4

But if i am setting my rootPath as /content/dam.

will it show asset icons aling with there names in pathbrowser window?