Expand my Community achievements bar.

SOLVED

Apache Sling Sitemap Generator - How to improve readability of created sitemaps

Avatar

Level 2

Hi all, 

Currently have the OOTB sitemap generator set up via Apache Sitemap Generator but noticed the xml is formatting in plain text on the page. The sitemap does pass validation.

Despite this, there is a need for us to fix the formatting to a proper xml page and wanted to see if there were possibly any workarounds in manually adjusting how the xml files are formatted outside of creating a custom sitemap generator.

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@asdasdsa 

Please follow the steps mentioned below to fix readability issue in sitemap

  1. Go to config manager (https://localhost:4502/system/console/configMgr) and search for Adobe AEM SEO - Page Tree Sitemap Generator  (com.adobe.aem.wcm.seo.impl.sitemap.PageTreeSitemapGeneratorImpl).

  2. Open the config and uncheck Add Language Alternates.

    Note - If enabled, a page’s language copies will be added as language alternates to the URL entry (enableLanguageAlternates).

  3. Save settings.

  4. Verify the use case.

https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-21789

 


Amanath Ullah

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @asdasdsa ,

What is the "Content-Type"  response header being send when you hit the sitemap URL ? It should be set to application/xml then it should render correctly in browser also.

Thanks,

Somen

Avatar

Level 2

Ah, I see. I'm noticing that these specific sitemaps are not showing the content type. Would there be a reason for why the content type does not correctly set for these specific sitemaps? They are all generated through the OOTB generator

Avatar

Correct answer by
Community Advisor

@asdasdsa 

Please follow the steps mentioned below to fix readability issue in sitemap

  1. Go to config manager (https://localhost:4502/system/console/configMgr) and search for Adobe AEM SEO - Page Tree Sitemap Generator  (com.adobe.aem.wcm.seo.impl.sitemap.PageTreeSitemapGeneratorImpl).

  2. Open the config and uncheck Add Language Alternates.

    Note - If enabled, a page’s language copies will be added as language alternates to the URL entry (enableLanguageAlternates).

  3. Save settings.

  4. Verify the use case.

https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-21789

 


Amanath Ullah

Avatar

Level 2

Thank you! I'm seeing it work perfectly. Curious, is there a reason this particular behavior exists with the language alternate config?

Avatar

Community Advisor

Hi,

This is due to a bug in Sling that hasn't been addressed yet. AEM relies on the Out-Of-The-Box (OOTB) Sling Sitemap Generation, which is likely where the problem originates.

 

 



Esteban Bustamante

Avatar

Community Advisor

 "Content-Type"  response header being send as html e.g. 

Content-Type: text/html;

As suggested by @somen-sarkar , It should be set to application/xml then it should render correctly in browser also. You can change this from dispatcher.

 

Please also check option to use visual sitemap

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-covert-sitemap-xml-... 



Arun Patidar

Avatar

Administrator

@asdasdsa Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni