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

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!

share|improve this question

migrated from stackoverflow.com Nov 28 '11 at 18:48

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers 4

This is simple. you should do the below.

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

share|improve this answer
    
Thanks Praveen that dis exactly what I wanted. –  user5830 Nov 29 '11 at 9:22
add comment

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>
share|improve this answer
add comment

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" />
share|improve this answer
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.