Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
How i can fetch current page components in cq5?
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
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
Visualizações
respostas
Total de curtidas
Hi,
so you are intereested in the page component?
String pageResourceType = currentPage.getProperties().get("jcr:resourceType");
You can only get the resourcetype reliably, page.getTemplate() doesn't work on publish
Jörg
Visualizações
respostas
Total de curtidas
Jörg Hoh wrote...
Hi,
so you are intereested in the page component?
String pageResourceType = currentPage.getProperties().get("jcr:resourceType");
You can only get the resourcetype reliably, page.getTemplate() doesn't work on publish
Jörg
Thanks for the reply.
My requirement is : i will search a page based on tag, it will show list of page having the tag name.
In result it will show page title,and link .
My need is : i need to show the list of component under the corresponding page.
Ex : Am searching "orientation" tag based search.
in result it will show pages, that contains orientation tag.
at that time i need to fetch corresponding result page components.
Visualizações
respostas
Total de curtidas
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
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas