0

I have a requirement where I need to rename the first element of the bread crumbs to another name. Currently it displays the name of the site i.e XYZ Intranet but instead of that I want to rename this as HOME.

Is there any way other than using a custom JavaScript to achieve this functionality. I have researched on this but have come across a single solution of using the custom JavaScript for this purpose.

Please suggest solutions for this.

The following is the code block that I have added in the master page for rendering the breadcrumbs.

<asp:SiteMapPath runat="server" SiteMapProviders="SPContentMapProvider,SPXmlContentMapProvider" RenderCurrentNodeAsLink="false" NodeStyle-CssClass="breadcrumbNode default-fontcolorC" CurrentNodeStyle-CssClass="breadcrumbCurrentNode default-fontcolorC" RootNodeStyle-CssClass="breadcrumbRootNode default-fontcolorC" HideInteriorRootNodes="false" SkipLinkText=""/>
2

This is how I have done it in one of my implementations:

   <!--Breadcrumb start -->

<asp:ContentPlaceHolder id="PlaceHolderBreadcrumb" runat="server">
    <div id="breadcrumb">
        <asp:SiteMapPath    
            ID="contentNavigation"
            runat="server"  
            SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
            RenderCurrentNodeAsLink="false"
            NodeStyle-CssClass="NodeBreadcrumb"
            CurrentNodeStyle-CssClass="breadcrumbCurrentNode"
            RootNodeStyle-CssClass="breadcrumbRootNode"
            HideInteriorRootNodes="false"
            SkipLinkText="">
            <RootNodeTemplate></RootNodeTemplate>
        </asp:SiteMapPath>
    </div>
    <script>
        $(document).ready(function(){ 
            var rootNode = $("span[id$=contentNavigation] > span:eq(0)");
            if (rootNode.attr("class") == "breadcrumbRootNode") {   

                $(rootNode).next("span a").text.replace('MyIntranet', 'Home');; }
        });
    </script>
</asp:ContentPlaceHolder>
<!-- Breadcrumb end -->

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.