views:

1182

answers:

1

Hi All,

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.

+2  A: 

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. :-)

Alex Angas
Hey Alex, Your suggestion on overriding the AspMenu worked well. Except the master page uses the SiteMapPath control to render the breadcrumb (not the AspMenu control), which fortunately is not sealed (like the AspMenu), so I overrode that and then overrode the CreateControlHierarchy method.I still had to create a custom SiteMapProvider to generate the display for the current node (which is not handled by the SiteMapPath).As an aside the reflector is a nifty tool.Thanks for the quick response.
Arnhem