How can I hide the root node in a SiteMapPath control when the user is on the root node page? For example, my breadcrumb trail on a child page is:
Home > Products > Hammers > Ball Peen
which is fine. But when the user is on the Home page, the SiteMapPath control displays
Home
which is useless clutter. I want to suppress displaying Home (the root node) when the user is on the home page. I have the SiteMapPath control in a master page. Also, I’m handling SiteMapResolve to set the querystrings in the nodes.
I managed to figure this out but it took a while because the problem I was having was somewhat subtle. schou-rode has the right idea and that is what I was doing in
Page_Loadwithout success. The reason it wasn’t working is because I was cloning the node inSiteMapResolveand returning the clone. This occurred beforePage_LoadsoSiteMap.CurrentNodereferenced the clone and the comparison toSiteMap.RootNodefailed.Here’s the full solution: