Tuesday 10 January 2017

Sitecore Module - Dynamic Sitemap XML

After a lot of work spent on creating project specific sitemap xml implementations I have prepared my own generic sitemap xml module. It is based on original marketplace sitemap module but adds some new great features.

It has two main assumptions:
  • Flexible configuration - to give end user as many as possible configuration options, because it is easier to edit Sitecore items than edit and deploy config files.
  • Extensibility - code functionality should be extensible and override-able. It should be easy to extend or override functionality, without decompiling and copy-pasting a lot of code.

Specifying your own logic

To use or not to use marketplace module - that is the question! Most times main reason to write your own sitemap implementation is thought if there will be some custom tricky functionalities needed. Something like some static html pages or other links that exist outside Sitecore.

You can specify your own logic, that can add your custom items to the sitemap.

You should create class that implements IItemsProcessor interface, put it in your assembly and attach your class to the site configuration item, in format MyType, MyAssembly.

In this approach, main functionality of module can be easily changed. More info here https://github.com/ReoKzK/Sitecore.SharedSource.DynamicSitemap/wiki/Specifying-your-own-logic

Separation from content

I also decided to definitely separate sitemap things from the actual content. So deciding whether the item goes to sitemap or nor or setting the change frequency or priority, is set on the sitemap configuration item in Sitecore. This approach will keep your items clean. More info here https://github.com/ReoKzK/Sitecore.SharedSource.DynamicSitemap/wiki/Creating-new-sitemap-configuration

That's all :)

Module is uploaded to official Sitecore Marketplace https://marketplace.sitecore.net/Modules/D/Dynamic_Sitemap_XML_Module.aspx

Whole documentation is available here https://github.com/ReoKzK/Sitecore.SharedSource.DynamicSitemap/wiki

Library is also available at nuget:
Install-Package Sitecore.SharedSource.DynamicSitemap
Hope that my module will be useful and will improve your websites development process.

Share it:

Radosław Kozłowski - Senior Sitecore Developer Radoslaw Kozlowski

Author & Editor

Sitecore MVP, passionate Sitecore & .NET developer and architect. Sitecore Community evangelist.


Post a Comment