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 Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...