Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
Nice reply! I thought there was an easier way as I thought about implementing tons of event receivers. –  Dennis G Oct 11 '11 at 13:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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