Expand my Community achievements bar.

SOLVED

Ability to link to other AEM articles/pages from a component

Avatar

Level 4

How can I allow authors to select other AEM pages through a  multi-mode dialog box, (i.e. use search to find the path to the other articles/pages they want to link), and then access the list using getProperty(), and hopefully, pull off the article/pages they selected as an object and retrieve its properties. I need to take this information and create at <div> that uses the image from the article, and also create an anchor/hyperlink to the chosen articles. Again, I am hoping I can get some type of page object for the article, and just pull off the properties needed to create a <div> with a hyperlink to the article's page, and also use any images associated with the articles as the <img src>.

In general, what's the most efficient way create a multi-mode dialog box list that allows authors to search/select content such as links to other AEM articles/pages, images in the DAM, and videos, and then retrieve and parse the list in my component, and identify whether the path provided is to an article/page, image or video???

1 Accepted Solution

Avatar

Correct answer by
Level 10

Take a look @ http://experience-aem.blogspot.in/2014/03/aem-cq-56-pathfield-widget-with-search.html

It gives you an option to search from pathfiled.

Integrate this with multifield pathfield in component, and I guess you will be good to go.

View solution in original post

3 Replies

Avatar

Level 10

The answer to that can be found in this AEM article. 

Populating AEM Component Dialog fields using JSON data returned by Sling Servlets

Now you would code the Sling Servlet to get the pages you want to return in JSON. You can use JCR API to query the JCR for the nodes that represent the other content you want to reference. Using this approach, you can do alot with AEM. 

Avatar

Level 4

Scott, thanks for the information, but I was talking about having a dialog where the author could either create a list that is a mix of images drug from the CF#, videos supplied by a service, or already located in the dam and selected through a search, and articles that are already a part of the AEM site and selected through a typical search where they are walking the site tree selecting the articles that they want.

The article you linked seems as if it would only apply to the videos coming from external sources outside of the DAM, (i.e. some service). I was hoping that I could retrieve the list of these three things in my component, hopefully as objects so that I could know how to format and build DIVs for each one to display properly, (including setting up <a href> to the articles/pages).

Avatar

Correct answer by
Level 10

Take a look @ http://experience-aem.blogspot.in/2014/03/aem-cq-56-pathfield-widget-with-search.html

It gives you an option to search from pathfiled.

Integrate this with multifield pathfield in component, and I guess you will be good to go.