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

We have a site collection that has language variations. So a breadcrumb might look like this

Root > English > Products > Page Title

We can using the sites title and description play around with the label for the language variation root so it looks like this

Root > Home > Products > Page Title

But the problem is hiding the root of the breadcrumb. The code looks something like this

<asp:ContentPlaceHolder id="PlaceHolderBreadcrumb" runat="server">
    <div id="master-page-breadcrumb">
        <asp:SiteMapPath    
            runat="server"                          
            SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
            RenderCurrentNodeAsLink="false" 
            NodeStyle-CssClass="SolidBreadCrumb"
            CurrentNodeStyle-CssClass="SolidBreadCrumbCurrent"
            RootNodeStyle-CssClass="SolidBreadCrumbRoot"
            HideInteriorRootNodes="false"
            SkipLinkText=""/>
    </div>
</asp:ContentPlaceHolder>

Using the RootNodeStyle and CSS you can hide the root no problem using the following CSS

<style>.HideRootNode { display:none; }</style>

The problem is this leaves you with a breadcrumb like this

> Home > Products > Page Title

The divider/separator is still there. What we are looking for is something like this

Home > Products > Page Title

There has to be some kind of simple option that I am missing. Also just to note, I am not a .NET developer so writing my own control or something is not an option.

I am going to start looking at jQuery to try and figure something out, but thought I would just get it out there in case I am missing something.

Thanks ... Mike

share|improve this question
    
Did you ever get this working? –  Steve Lineberry Feb 14 '13 at 19:53
add comment

2 Answers

up vote 1 down vote accepted

Hello Everyone looking to solve this problem. Here is what we did to hide the root link of the site collection using jQuery ...

<!--[ Breadcrumb ]------------->
<!----------------------------->
<asp:ContentPlaceHolder id="PlaceHolderBreadcrumb" runat="server">
    <div id="master-page-breadcrumb">
        <asp:SiteMapPath    
            ID="contentNavigation"
            runat="server"  
            SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
            RenderCurrentNodeAsLink="false"
            NodeStyle-CssClass="breadcrumbNode"
            CurrentNodeStyle-CssClass="breadcrumbCurrentNode"
            RootNodeStyle-CssClass="breadcrumbRootNode"
            HideInteriorRootNodes="false"
            SkipLinkText="">
            <RootNodeTemplate></RootNodeTemplate>
        </asp:SiteMapPath>
    </div>
    <style>.HideRootNode { display:none; }</style>
    <script>
        $(document).ready(function(){ 
            var rootNode = $("span[id$=contentNavigation] > span:eq(0)");
            if (rootNode.attr("class") == "breadcrumbRootNode") {   
                rootNode.hide();
                $(rootNode).next("span").css('display', 'none'); }
        });
    </script>
</asp:ContentPlaceHolder>
<!-- ---------------- -->

Thanks goes to Jeremiah Walker from Imaginet for this one. Hope it works for everyone who needs this.

share|improve this answer
add comment

Having not looked at the html/css, the first css only idea that came to mind is using the css:first-child selector: http://www.w3schools.com/cssref/sel_firstchild.asp

If you can't do it that way you could do it in jQuery pretty easily.

share|improve this answer
    
That is the next play, tried the first child, but that leaves the '>' just hanging at the start. Will post back when I got it fixed. –  mdumka Feb 15 '13 at 4:02
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.