Expand my Community achievements bar.

Introducing Adobe LLM Optimizer: Own your brand’s presence in AI-Powered search and discovery

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Display the complete page hierarchy

Avatar

Community Advisor

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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-...

 

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

 

View solution in original post

5 Replies

Avatar

Employee Advisor

@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

 

Avatar

Community Advisor

@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/ad...

 

Avatar

Community Advisor

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?

Avatar

Correct answer by
Community Advisor

@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-...

 

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

 

Avatar

Community Advisor

@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-...

 

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