Current Page component
How i can fetch current page components in cq5?
How i can fetch current page components in cq5?
Hi,
Have you tried to use the TagManager API [1]? It has some search methods, which return resources; these can return any resource with the given tags; then you need to post-process the result and find the pages for these resources (if these exist); if you can limit your requirement only to find pages which have a certain tag, you can try to use the adaptTo() approach to convert your search result resources to pages (if applicable).
Resource r = ... Page page = r.adaptTo(Page.class); if (p != null) { // read title and path to create the link } else { // the tag is not on page, but rather on a different node }HTH,
Jörg
[1] https://docs.adobe.com/docs/de/aem/6-0/develop/ref/javadoc/com/day/cq/tagging/TagManager.html
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.