Question

I need to customise the title property for SiteMapNodes.

I am using WSS, and have created a custom document library. While navigating through this library I want to change the names of the nodes in the breadcrumb displayed above the list name.

So far I have:

  • created a class inheriting from System.Web.SiteMapProvider,
  • added my class to the web.config,
  • changed the sharepoint default.master page sitemappath (in PlaceHolderTitleBreadcrumb) to point to my new site map provider.

I then overwrote the CurrentNode property to edit the CurrentNode.title with the desired name.

My problem is all the previous nodes (parent nodes) revert back to their original names. How do I edit the breadcrumb so that all the nodes navigated through keep their new title?

Any advice or direction would be appreciated.

Was it helpful?

Solution

The way I've done this before isn't by creating a new SiteMapProvider, but by replacing the sealed SharePoint AspMenu control with MossMenu (the same as AspMenu but open sourced by the SharePoint team). I then overrode OnMenuItemDataBound with the behaviour I needed.

If you need/prefer to use SiteMapProvider, have you tried using Reflector or the new .NET Framework debugging support to see how it works? There must be somewhere in the SiteMapProvider code where your overridden changes are, in turn, also being overridden. :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top