Thursday, July 21, 2016

Hide Pages link in SharePoint breadcrumb

Its possible to have a custom site map provider developed in C# and use it to hide pages link in the breadcrumb, but while looking for a rather simpler solution, I found out the blog post below which mentioned a much cleaner and less time consuming way of achieving similar result.

The trick is to add two breadcrumb controls in master page, one for path and another one for the leaf node like so:

<asp:SiteMapPath ID="bestpath" Runat="server"
        SiteMapProvider="GlobalNavSiteMapProvider"
        CssClass="ms-sitemapdirectional"
        NodeStyle-CssClass="ms-sitemapdirectional"
        RenderCurrentNodeAsLink="true"
    /> >
    <asp:SiteMapPath ID="bestsubpath" Runat="server"
        SiteMapProvider="SPContentMapProvider"
        CssClass="ms-sitemapdirectional"   
        NodeStyle-CssClass="ms-sitemapdirectional"
        RenderCurrentNodeAsLink="false"
        CurrentNodeStyle-CssClass="breadcrumbCurrent"
        ParentLevelsDisplayed="0"

    />

No comments:

Regex obfuscate email

 Use this code in C# to obfuscate email using regex // Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compile...