We have custimized the AEM's OOTB sitemap by creating new service by extending the ResourceTreeSiteMapGenerator and
overriding addResource() method there. In that service method, I am able to successfully modify the URL and lastModified values. But I have additional requirements to add new attributes in the sitemap (highlighted in blue color). I found that, there is no direct way to do that in the service. I think we can do builder-like API support for these custom extensions which is like creating a few interfaces and classes (just to include a few attributes there). Can somebody confirm if there is any other way?
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.xyz.org/abc/a1.html</loc>
<data:news>
<news:author>
<news:title>The Example Times</news:name>
<news:language>en</news:language>
</news:author>
</data:news>
</url>
</urlset>
Solved! Go to Solution.
Views
Replies
Total Likes
hi @karanmahi , you are right, there is no ootb configuration available for the sitemap service to modify the sitemap as you have mentioned above. To achieve this, you have to add your own logic in the extended class and use builder API to for the content.
hi @karanmahi , you are right, there is no ootb configuration available for the sitemap service to modify the sitemap as you have mentioned above. To achieve this, you have to add your own logic in the extended class and use builder API to for the content.
Views
Likes
Replies