Display the complete page hierarchy | Community
Skip to main content
Avinash_Gupta_
New Participant
Nov 2, 2022 3:45 AM UTC
Solved

Display the complete page hierarchy

Hello Everyone,

 

There is a use case to display the entire site hierarchy for example how it's appearing on this site https://www.ingredion.com/na/en-us/sitemap.html . Existing core list component display all the child pages but it won't maintains the hierarchical order. I have extended this component but struggling with the logic to display the site structure. Would you please help me on that.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jagadeesh_Prakash
Jagadeesh_PrakashAccepted solution
New Participant
Nov 2, 2022 10:22 AM UTC

@avinash_gupta_ If you don't want to use ACS-commons still u can use the servlet code to achieve this using a servlet. Refer to below link 

 

https://aemsimplifiedbynikhil.wordpress.com/2021/12/01/extending-the-apache-sling-sitemap-generator-for-aem-6-5-11-and-aemaacs/

 

After the sitemap is generated you can use the xml to generate your HTML structure look and feel 

 

5 replies

Jagadeesh_Prakash
New Participant
Nov 2, 2022 6:17 AM UTC

@avinash_gupta_  you can use ACS commons sitemap generator and make an API call to sitemap.xml and parse the XML response to display the site structure in html. 

 

https://adobe-consulting-services.github.io/acs-aem-commons/features/sitemap/index.html

 

https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/SiteMapServlet.java

 

Translate
Avinash_Gupta_
New Participant
Nov 2, 2022 8:30 AM UTC

Thanks @jagadeesh_prakash for replying on my post but in our project we are not using acs-commons and don’t want to generate the sitemap. How can we achieve it using using sling models?

Translate
Jagadeesh_Prakash
Jagadeesh_PrakashAccepted solution
New Participant
Nov 2, 2022 10:22 AM UTC

@avinash_gupta_ If you don't want to use ACS-commons still u can use the servlet code to achieve this using a servlet. Refer to below link 

 

https://aemsimplifiedbynikhil.wordpress.com/2021/12/01/extending-the-apache-sling-sitemap-generator-for-aem-6-5-11-and-aemaacs/

 

After the sitemap is generated you can use the xml to generate your HTML structure look and feel 

 

Translate
krati_garg
Employee
Nov 2, 2022 6:00 AM UTC

@avinash_gupta_ 

Please explore Apache Sling SiteMap Scheduler and Generator provisioned with AEM. Below is the video tutorial for the same:

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html?lang=en

 

Translate