Expand my Community achievements bar.

SOLVED

Image widget wherein we should be able to drop an image from content finder along with click to upload from local machine : BIT URGENT

Avatar

Level 9

Hi All, 

I am making use of the below section in my dialog for the image to appear. However, if I upload the image from my local instance, I see entries in the crx below my component 

as 

1] /component/jcr:content/file : with some basic properties like created by and primary type.

2] /component/jcr:content/file/jcr:content : with properties as jcr:data, some fields w.r.t last modification, jcr:mimetype, jcr:primarytype, jcr:uuid.

3] If I want to show this image component on the page[in footer section], what property should I use in java file to read and display in my sightly.

Any thoughts/pointers/reference/snippet on this will be really helpful.

<image
                        jcr:primaryType="cq:Widget"
                        allowBlank="{Boolean}true"
                        allowUpload="{Boolean}true"
                        border="{Boolean}true"
                        ddGroups="[media]"
                        fieldLabel="Footer Image"
                        fileNameParameter="./fileName"
                        fileReferenceParameter="./fileReference"
                        height="200"
                        name="./file"
                        xtype="smartimage"/>

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi

[Exactly what you are looking for]

Please have a look at this community article:

Demo:- https://drive.google.com/file/d/0B4d6KmbLkAumWnUzVWNRcVpBT0U/view?pref=2&pli=1

Package:- https://drive.google.com/file/d/0B4d6KmbLkAumeFRNblpORExZUjQ/view?pref=2&pli=1

Link:- http://experience-aem.blogspot.in/2015/08/aem-61-touch-ui-fill-dialog-fields-with-default-values-on-...

 

This is exactly what you are looking here. This component allows you to upload image from content finder and as well as from local file system.

Please confirm if you have any problem in this.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

8 Replies

Avatar

Level 10

A lot of the questions that you are asking can be addressed by reading and understanding the SIghtly logic in this article:

https://helpx.adobe.com/experience-manager/using/movie.html

This article talks about using assets in SIghtly. 

Avatar

Level 9

Hi Scott,

Thank you for your reply.

Went through the article, but the media file is fetched from DAM location. With the dialog structure which I am trying[mentioned above], not sure how do I read an external[i.e, uploaded from my local machine] image. Not getting it.

Avatar

Level 10

Before you can use an AEM component dialog to select an image, you need to get the image from desktop to JCR . Once you do that, you can build a component dialog to select image. 

Avatar

Level 10

A lot of the questions that you are asking can be addressed by reading and understanding the SIghtly logic in this article:

https://helpx.adobe.com/experience-manager/using/movie.html

This article talks about using assets in SIghtly. 

Avatar

Level 10

It's like how we select the video in the artilce; same idea - except in your use case - you want to select an image, Then the image is displayed in a Sightly component. But as i stated - make sure you get the image into the JCR (DAM or another location) 

Avatar

Level 9

Hi Scott,

Also, in the article here, https://helpx.adobe.com/experience-manager/using/creating-logo.html servlet is used. Trying to make use of this, but no luck.

I was under the impression that we will be able to display images from DAM as well as the one present on the local computer machine.

Avatar

Correct answer by
Administrator

Hi

[Exactly what you are looking for]

Please have a look at this community article:

Demo:- https://drive.google.com/file/d/0B4d6KmbLkAumWnUzVWNRcVpBT0U/view?pref=2&pli=1

Package:- https://drive.google.com/file/d/0B4d6KmbLkAumeFRNblpORExZUjQ/view?pref=2&pli=1

Link:- http://experience-aem.blogspot.in/2015/08/aem-61-touch-ui-fill-dialog-fields-with-default-values-on-...

 

This is exactly what you are looking here. This component allows you to upload image from content finder and as well as from local file system.

Please confirm if you have any problem in this.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Administrator

Reference:- /libs/granite/ui/components/foundation/form/fileupload

// For Uploading files from File system.



Kautuk Sahni