Skip to content
CPyle edited this page Feb 20, 2013 · 5 revisions

Advanced Sitemap offers two simple extension points that developers creating custom sites can take advantage of.

ISitemapRouteFilter

Implementing this interface will allow you to filter out urls from appearing in both the XML and HTML sitemaps. Simply do your filtering and return false if a particular path shouldn't be considered.

ISitemapRouteProvider

Implementing this interface will allow you to supply the sitemap with additional routes. This is particularly useful if you have implemented lots of custom MVC routing into your solution and still wish to programatically generate your sitemap without having to enter custom routes by hand using the gui.

Advanced Sitemap currently uses two route providers (Content & Custom) that are configured via the admin. It would be completely possible to create your own route providers and offer your own administration for them in another tab.

XML Routes

All XML routes should provide as many of the SitemapRoute properties as possible.

Display routes

When providing routes for Display, only the Title and Url are needed.

Provider priority

Providers with a higher Priority number have their routes retrieved first. These routes will have a higher precedence than routes obtained from lower priority providers.

Refreshing the sitemap cache

The sitemap is aggressively cached. Issuing the following signals via the Orchard ISignals interface will allow you to invalidate the cache:

"WebAdvanced.Sitemap.Refresh" - Issue this signal to rebuild the sitemap cache from all available route providers.

"sitemap.xml" - This signal will rebuild the XML sitemap result, and is usually issued once per hour.

Clone this wiki locally