0

So there are a gazillion of different SiteMap providers in SharePoint:

  • SPNavigationProvider
  • SPSiteMapProvider
  • SPContentMapProvider
  • SPXmlContentMapProvider
  • SPXmlAdminContentMapProvider
  • CombinedNavSiteMapProvider
  • CurrentNavSiteMapProvider

To name a few. I found some tutorials on how to create my own SiteMap - all of them describe how I would in the end create an XML file with the SiteMapNodes with fixed URLs. When someone renames a page, my SiteMap will not be updated, hence broken!?

How is SharePoint updating its navigation menus (SiteMaps)? Is there a secret timer job running? Is this ASP.NET standard? How would I implement my own self-updating sitemap?

1 Answer 1

1

Sharepoint maintains its sitemap in database and not in xml.The database is updated as soon as you create new list or page.

If you want to create a self updating XML sitemap for specific items like pages or sites, you can do it with custom event receivers. For updating xml when:

  1. New pages are added\deleted : Write SPItemEventReceiver
  2. New Lists are added\deleted :Write SPListEventReceiver
  3. New webs are added\deleted: Write SPWebEventReceiver

If you want to update xml for everything, Write a timer job to read from PortalSiteMapProvider. You can programmatically enumerate the sitemapnodes in any of the PortalSiteMapProvider implementations you listed above and write it to xml sitemap file.

1
  • Nice reply! I thought there was an easier way as I thought about implementing tons of event receivers.
    – Dennis G
    Commented Oct 11, 2011 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.