Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How can I use the rendition images in dialog??

Avatar

Level 3

I upload a image through damadmin, because of oob workflow the image was rendered into 5 different pixels under image->jcr:Content->Rendition->image pixels.

How can i use that rendition images directly in dialog without manual mapping.

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 5

I hope you should be able to select child nodes by adding the below property.

predicate="nosystem"

predicate.png

View solution in original post

8 Replies

Avatar

Level 2

What software are you using? You've posted in the non-support, general forum Lounge. Users from all of Adobe's clouds hang out here. If you let us know what software you're using, a moderator can move your post to the right forum. As it is, I don't know if you're talking about something in Business Catalyst, Acrobat, InDesign, Dreamweaver, or something else.

Avatar

Level 1

moved to Adobe Experience Manager

Avatar

Level 5

Hi prabhu,
What do you mean by direct use. Can you please elaborate?         

Avatar

Level 3

Hi Susheel,

In dialog for mapping the image i'm using image path filed. In properties I have mentioned the root path for the path field. While clicking on it,it makes me to choose the images of node.Here how can i choose the rendition images .

Avatar

Correct answer by
Level 5

I hope you should be able to select child nodes by adding the below property.

predicate="nosystem"

predicate.png

Avatar

Level 3

There is no OOTB way to use the image field in a dialog and utilize a rendition.  You would need to add some custom Java code to get the rendition based on the image.  If you're using the image field in your dialog, you can do something like this (this hasn't been tested, just a guideline).

public String getImageRendition() {

    Image image = new Image(this.getResource(), "image");

    if (image != null && image.hasContent()) {

        Asset imageAsset = image.adaptTo(Asset.class);

        if (imageAsset != null) {

            Rendition rendition = imageAsset.getRendition("renditionName");

            if (rendition != null) {

                return rendition.getPath();

            }

        }

    }

    return null;

}

This obviously assumes you're saving your image node as "image" and you're using the image field.  One word of caution - i'm not sure it's a good idea to expose the direct path to the image rendition to the public, but ultimately that's a business decision.

Avatar

Community Advisor

I agree with lasling​ . To add to that adding below a snippet from one of my project (modified accordingly, Please make sure to use constants in a seperate class.)

As a part of our requirement , we passed the node to get the asset and fetched the required rendition accordingly.

Why the rendition is set in the above manner is because, when this is published via dispatcher , assume your rendition path is /content/dam/geometrixx/documents/GeoCube_Datasheet.pdf/jcr:content/renditions/cq5dam.thumbnail.48.48.png ; then in dispatcher , it will create a folder structure as below

  content

    --> geometrixx

               --> documents

                         -->GeoCube_Datasheet.pdf

                                   --> jcr:content

                                        -->renditions

                                             -->cq5dam.thumbnail.48.48.png

   

  And so in your publisher end, if you try to access your page via dispatcher with image renditions, none of your images will be loaded and directly hitting those images over dispatcher will throw you 404. Hence , to skip this behavior , we refer any rendition in below format to access it over dispatcher

/content/dam/geometrixx/documents/GeoCube_Datasheet.pdf/jcr:content/renditions/cq5dam.thumbnail.48.48.png  this should be referred as /content/dam/geometrixx/documents/GeoCube_Datasheet.pdf.thumb.48.48.png