Skip to content

The Breadcrumb in SharePoint 2010

October 31, 2011

The breadcrumb in SharePoint is useful just like the other navigation elements like the global navigation. In SharePoint 2010 we have the PopoutMenu control which can be visible if you click at the folder icon in the ribbon. That’s cool, but if you want to display the breadcrumb as a part of every pages without the need to activate it, it just to add a ASP:SiteMapPath control onto your custom masterpage.

SiteMap

There’s no limit when it comes to style the breadcrumb, you can have a custom background and an image that separates the nodes if you like to. In my example I have placed the following code just above the ContentPlaceHolder ‘PlaceHolderMain’ tag in my custom masterpage.

<div class="BreadCrumbWrap s4-notdlg">
<asp:SiteMapPath runat="server" SiteMapProvider="SPContentMapProvider" id="ContentMap"	CssClass="BreadCrumbStyle" PathSeparator="&gt;">
<CurrentNodeStyle CssClass="BreadCurrentNode" />
<PathSeparatorStyle CssClass="BreadPathSeparator" />	
</asp:SiteMapPath>
</div>

Add the following CSS classes to your custom CSS file, referenced from the custom masterpage.

CSS

.BreadCrumbWrap {
margin-top:10px;
}
.BreadCrumbStyle {
padding-left:15px;
font-size:10px;border-bottom:1px #ebebeb dotted;	
padding-bottom:5px;
}
.BreadCrumbStyle a:link, .BreadCrumbStyle a:visited {
color:#3b4f65;
}
.BreadCrumbStyle a:hover{
color:#0072bc; text-decoration:underline
}
.BreadCurrentNode {color:#0072bc}
.BreadPathSeparator{
color:#ccc; padding:0px 8px 0px 8px;
}

/ Christian

Advertisement
7 Comments
  1. Andy permalink

    Hey Christian,

    I placed your bread crumb div right above in my master page. I found this bread crumb missing for the pages like Site Settings,All Site Content,Libraries, Lists ..etc (which are under “_layouts”). Any thoughts on this one ?

    Thanks

    • Andy permalink

      I think in my comment it took out div tag, What I was saying is, I placed your bread crumb div right above “s4-main area” div in my master page. I found this bread crumb missing for the pages like Site Settings,All Site Content,Libraries, Lists ..etc (which are under “_layouts”). Any thoughts on this one ?

  2. Hi Andy, if you add something into your custom master this should displays at pages in subsites that inherit this master even in application _layouts pages like settings.aspx by default. There’s a setting for this in Central Admin for the current web application called ‘Master Page Setting for Application _Layouts Pages’, make sure to select ‘Yes’ here.
    / C

  3. Andy permalink

    Hey Christian,

    Thanks for your reply. The setting that you mentioned was already selected as “Yes” but still for some reason bread crumb was missing for the application pages.

    But actually I solved the problem by replacing the sitemap provider tag with the following SiteMapProviders=”SPSiteMapProvider,SPXmlContentMapProvider”

  4. Brett permalink

    Thanks for this Christian, I’ve added your code to my master page because my breadcrumbs weren’t working and now it works great. Much appreciated. :)

Trackbacks & Pingbacks

  1. SharePoint Daily » Blog Archive » Do You Really Use SharePoint?; Enterprization of Consumer Apps; Mozilla & Microsoft vs. Google
  2. Do You Really Use SharePoint?; Enterprization of Consumer Apps; Mozilla & Microsoft vs. Google - SharePoint Daily - Bamboo Nation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 472 other followers