Apache Sling Sitemap Generator - How to improve readability of created sitemaps | Community
Skip to main content
Level 2
July 31, 2024
Solved

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

  • July 31, 2024
  • 4 replies
  • 1907 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AMANATH_ULLAH

@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

 

4 replies

somen-sarkar
Community Advisor
Community Advisor
July 31, 2024

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

asdasdsaAuthor
Level 2
July 31, 2024

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

AMANATH_ULLAH
Community Advisor
AMANATH_ULLAHCommunity AdvisorAccepted solution
Community Advisor
July 31, 2024

@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
asdasdsaAuthor
Level 2
July 31, 2024

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

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 31, 2024

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
arunpatidar
Community Advisor
Community Advisor
July 31, 2024

 "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-to-visual-sitemap/m-p/456720 

Arun Patidar
kautuk_sahni
Community Manager
Community Manager
August 1, 2024

@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