Expand my Community achievements bar.

SOLVED

Get property of Item from content finder

Avatar

Former Community Member

Hi,

We drag and drop some components from the content finder tab onto a page that has a component that can accept the item being dropped. We configure cq:droptarget for it. Now when we drag thee component the 'path' of the component is set as value to the configured field in the dialogue.

is it possible to get some other value of the component (that is part of the JSON being returned by query builder in the JS that displays the data in content finder) that can be stored in some other field of the dialog ?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

When you say drag and drop components from Content Finder - are you referring to Digital Assets located in the Content Finder? 

This project may help you - it describes using Use QueryBuilder HTTP API. You can use this API to get data from the assets. 

http://adobe-consulting-services.github.io/acs-aem-commons/features/contentfinder-querybuilder.html

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

When you say drag and drop components from Content Finder - are you referring to Digital Assets located in the Content Finder? 

This project may help you - it describes using Use QueryBuilder HTTP API. You can use this API to get data from the assets. 

http://adobe-consulting-services.github.io/acs-aem-commons/features/contentfinder-querybuilder.html

Avatar

Former Community Member

Hey Scott,

Well, not the digital assets in our case. we have added a custom tab in COntent Finder to fetch nodes from a specific tree under /content. We are able to see the relevant details and have used query builder to fetch the JSON. The query builder predicate is:

                "path": "/content/<my-app>/carousels/",
                "p.nodedepth": 5,
                "nodename": "carousels",
                "p.limit": 1000,
                "p.hits" : "full"

THis returns a JSON with all the properties as defined by us for the particular component. Now, my use case is that I need to fetch 2 properties and set them in the dialog. As we have defined a cq:droptarget node, the path of the node being dragged is copied to the field of the dialog. I want one more property to fetched from the querybuilder JSON and set it in one more field. 

What can be done to achieve this ?

 

Thanks