0

I am working on an on-premises sharepoint 2013. and i have a team site collection, where i want to add a bread crumb navigation to it. so i created a custom master page , then i added the following code:-

<asp:ContentPlaceHolder id="customBreadcrumb" runat="server">
    <asp:SiteMapPath runat="server" SiteMapProvider="SPContentMapProvider" RenderCurrentNodeAsLink="false" NodeStyle-CssClass="breadcrumbNode" CurrentNodeStyle-CssClass="breadcrumbCurrentNode" RootNodeStyle-CssClass="breadcrumbRootNode" HideInteriorRootNodes="true" SkipLinkText=""/>
</asp:ContentPlaceHolder>

just before the built-in code:-

<div id="contentBox"

now using a site collection admin, i can see the breadcrumb navigation, but when i access the site using a user with contribute permission, i got the following error:-

"401 UNAUTHORIZED"

now if i modify the master page and i remove the breadcrumb related code, the error will disappear.. so not sure why this code will not run if the user have contribute permission:-

now i repeat this process on another team site collection and even users with Read permission where able to see the breadcrumb, but the difference is that inside this site collection i have enabled the publishing features,, while on the site collection which is causing the problem i did not enable the publishing features(and i am not planning to do this, as this site already contain many lists and libraries, and i do not want to have any side effect after enabling the publishing features..)

  • Did you check in, publish, and approve the masterpage change? The masterpage gallery has content publishing and approval on by default. Also, the contentplaceholder "customBreadCrumb" means nothing to SharePoint, so I'd just put it in a div and leave it out of a contentplaceholder. – Mike Oct 24 '17 at 16:02
  • @Mike yes i have check-in/check-out the master page , and the master page is being published as major version. now regarding adding Div i do not think this is the problem , since when i login using admin account the breadcrumb worked well.. also when i try my appraoch on another site collection which have the publishing featured enabled, i can use the breadcrumb even with a user who have read-only permission... also the approach i am following is found inside this link blog.sharepointexperience.com/2015/08/… – john Gu Oct 25 '17 at 0:58
  • 1
    @Mike now i read about similar issues on the web,,, and when i disable the minimal download strategy site feature the error disappeared!!! not sure what is the relation between the 2 ?? – john Gu Oct 25 '17 at 1:17
  • 1
    yes the MDS is known to sometimes cause 401 errors if the masterpage is not quite right. Is your masterurl and custommasterurl the same? MDS fails if not. See: benstegink.com/… – Mike Oct 25 '17 at 1:46
  • @Mike can you please advice how i can check this Is your masterurl and custommasterurl the same??? – john Gu Oct 25 '17 at 10:13
0

have you try this one?. Use in your custom html master page

<div class="CustomBreadcrumbs">

    <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
        <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">-->
            <!--MS:<asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="false" hideinteriorrootnodes="true">-->
         <!--ME:</asp:sitemappath>-->
        <!--SPM:</asp:ContentPlaceHolder>-->
    <!--SPM:</SharePoint:AjaxDelta>-->
</div>

https://social.msdn.microsoft.com/Forums/office/en-US/daabd903-df98-41da-80d8-6a942d06980e/add-breadcrumb-to-custom-master-page-html-file?forum=sharepointcustomization

  • in my case i am modifying the .master version of the master page not the html version.. and as i mentioned my original code worked well on other site collections,,, and also inside the site collection which is causing the problem, i have disabled the minimal download strategy site feature and the error disappeared ,, but i still need to have the breadcrumb + the Minimal download strategy enabled – john Gu Oct 25 '17 at 10:21

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.