11

I have a custom breadcrum for my site. It works almost perfectly, the only issue I have is that it is displaying full paths like so:

Home > About Us > Pages > Awards

I would prefer for the breadcrumb to display the following:

Home > About Us > Awards

Is there a way to get rid or ommit the "Pages" from the breadcrumb?

Here is the code I have:

<!--Adding additional custom breadcrumb -->
<div class="BreadCrumbWrap s4-notdlg">
<asp:SiteMapPath runat="server" SiteMapProvider="SPContentMapProvider"   
id="ContentMap"   CssClass="BreadCrumbStyle" PathSeparator="&gt;">
<CurrentNodeStyle CssClass="BreadCurrentNode" />
<PathSeparatorStyle CssClass="BreadPathSeparator" /> 
</asp:SiteMapPath>
</div>

Any assistance will be greatly appreciated. Thanks in advance!

8

This is simple. you should do the below.

Change the SiteMapProvider to CurrentNavSiteMapProviderNoEncode, this will solve the problem. :)

1

Check this out : http://www.novolocus.com/2008/05/07/my-breadcrumbs-have-pages-default-aspx-in-them/

1

If you remove the "SiteMapProvider" attribute and you should get the following output:

Home > About Us > Awards

<asp:SiteMapPath 
    runat="server" 
    id="ContentMap"   
    CssClass="BreadCrumbStyle" 
    PathSeparator="&gt;">
    <CurrentNodeStyle CssClass="BreadCurrentNode" />
    <PathSeparatorStyle CssClass="BreadPathSeparator" /> 
</asp:SiteMapPath>
1

I do breadcrumbs slightly different. I just have the parent items show (in your case it would show: Home > About Us ). The current item is a title somewhere else on the page.

<asp:SiteMapPath 
ID="siteMapPath" 
Runat="server" 
SiteMapProvider="CurrentNavSiteMapProviderNoEncode" 
RenderCurrentNodeAsLink="true" 
SkipLinkText="" 
CurrentNodeStyle-CssClass="breadcrumbCurrent" 
NodeStyle-CssClass="ms-sitemapdirectional" />
0

I just made an extensive post about this. In that thread is code that you can drop in your master page that will do just what you want. There are examples, too, to show what the different paths will look like.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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