Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Aem OOTB sitemap generator for dynamic pages

Avatar

Level 3

we have product pages rendering dynamically from external , without the physical page actually present in aem ex:/content/wknd/us/en/products is the existing page but our product pages will be generated with suffix without actually having the pages in aem.  is there a way to extend the ootb sitemap functionality to include these dynamic urls using custom code

 

@Imran__Khan @arunpatidar 

8 Replies

Avatar

Community Advisor

Hi @pradeep8910 ,

If you want to include external URL in your sitemap then one approach I'd suggest is that mention all these URLs in a file.
Then upload this file in DAM.
Now in your custom code you can read this file asset and show the external URLs in sitemap.


Thanks
Tarun

Avatar

Level 3

hi @TarunKumar 

how do i extend the OOTB sitemap functionality to read the references from the upload asset, so that my OOTB functionality still works butthe dynamic urls are added to the sitemap

Avatar

Community Advisor

Hi @pradeep8910 ,

Yes, you can extend the Out-of-the-Box (OOTB) sitemap functionality in Adobe Experience Manager (AEM) to include dynamic URLs generated from external sources. Here's a general approach you can take:

  1. Custom Sitemap Generation Component: Develop a custom component or service to generate the sitemap. This component will need to fetch the dynamic URLs from your external source and include them in the sitemap XML.

  2. Integration with External Source: Implement a mechanism to fetch the dynamic URLs from your external source. This could involve using HTTP requests, APIs, or any other suitable method to retrieve the URLs.

  3. XML Generation: Once you have the dynamic URLs, you need to format them into XML according to the sitemap protocol. You can use Java libraries like JAXB or Apache Sling Models to help with XML generation.

  4. Sitemap Configuration: Configure AEM to use your custom sitemap generation component instead of the OOTB one. This typically involves configuring a servlet or a job to trigger the generation of the sitemap XML.

  5. Scheduled Generation: Schedule the sitemap generation job to run periodically to keep the sitemap up-to-date with any changes in the dynamic URLs.

By following these steps, you can extend the OOTB sitemap functionality in AEM to include dynamic URLs from external sources. Keep in mind that you'll need appropriate permissions to develop and deploy custom code in your AEM instance.

Avatar

Community Advisor

@pradeep8910 

There is no out-of-the-box (OOTB) functionality in AEM to generate a sitemap for dynamic pages that are not physically present in the repository. However, you can extend the existing sitemap functionality by implementing a custom sitemap generator.

 

Avatar

Level 10

Agreed OOTB I don’t see an option but extending might help. However have these urls embedded within robots would help along with existing? 

Avatar

Administrator

@pradeep8910 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 1

For a project, we used the default sitemap which generated URLs for dynamic PDP (Product Detail Pages)