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

I am trying to create a new, custom administration page for lists and document libraries, for SharePoint 2010. I have created a custom application page, and it is getting deployed, getting the list ID, and generally working fine. However the breadcrumb shown on the page is:

 Home > My Page

Where "My Page" is the text I put into the "PlaceHolderPageTitleInTitleArea" content tag. I would like the breadcrumb to mirror the other, similar administration pages, which look like this:

 Home > My Library > Document Library Settings > General Settings

I've added a new entry to layouts.sitemap.xml, based on similar entries, that looks like this:

 <siteMapNode url="/_layouts/MyCompany/Features.aspx?List=1" 
              parentUrl="/_layouts/listedit.aspx" 
              title="My custom features" 
              requiredParameters="List" />

But this hasn't had any effect. Is there something I need to do on the ASPX page itself (or elsewhere) to get this to take effect? Or am I missing a step?

Help very much appreciated, and thanks!

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I have it working now; here's what I discovered from poking around 14 hive.

First, you need to create a layouts.sitemap.*.xml file that lists your additions to the site structure, and deploy it to the LAYOUTS directory. If you look in the LAYOUTS you'll see a bunch of these files in there which you can use as examples. For a page that hangs off the List Settings screen it should look something like this:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap enableLocalization="true">
  <siteMapNode url="/_layouts/MySettingsPage.aspx?List=1" parentUrl="/_layouts/listedit.aspx" title="My Settings" requiredParameters="List" />
</siteMap>

Note that you'll need to copyappbincontent on each front-end server to get your pages merged into the main sitemap.

Even though your page is listed in the sitemap, SharePoint will still pretend it doesn't know about it until you wire things up on the page itself.

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
  <a href="<%= SPHttpUtility.UrlPathEncode(list.DefaultViewUrl, true) %>">
    <% SPHttpUtility.HtmlEncode(list.Title, Response.Output); %>
  </a>
  <SharePoint:ClusteredDirectionalSeparatorArrow runat="server" />
  <a href="<%= SPHttpUtility.UrlPathEncode("listedit.aspx?List={" + list.ID.ToString() + "}", true) %>">
    <SharePoint:FormattedStringWithListType runat="server" String="<%$Resources:wss,listsettings_titleintitlearea%>" LowerCase="false" />
  </a>
  <SharePoint:ClusteredDirectionalSeparatorArrow runat="server" />
  <SharePoint:EncodedLiteral runat="server" text="My Settings Page" EncodeMethod='HtmlEncode'/>
</asp:Content>

<asp:Content contentplaceholderid="PlaceHolderTitleBreadcrumb" runat="server">
  <SharePoint:ListSiteMapPath
    runat="server"
    SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
    RenderCurrentNodeAsLink="false"
    PathSeparator=""
    CssClass="s4-breadcrumb"
    NodeStyle-CssClass="s4-breadcrumbNode"
    CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
    RootNodeStyle-CssClass="s4-breadcrumbRootNode"
    HideInteriorRootNodes="true"
    SkipLinkText="" />
</asp:Content>

This seems like a lot of work. I can't help but think that there ought to be a standard SharePoint "breadcrumb" control that leverages the sitemap and provides standard behavior and formatting. But this is how Microsoft's own pages seem to do it.

Hope this helps someone!

share|improve this answer
add comment

You can make the breadcrumb global by placing the ListSiteMapPath control into the master page's Content Place Holder for the breadcrumb like so :

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"> 
<asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" runat="server"/> 
<SharePoint:ListSiteMapPath ID="ListSiteMapPath1"
    runat="server" 
    SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
    RenderCurrentNodeAsLink="false"
    PathSeparator=""
    CssClass="s4-breadcrumb"
    NodeStyle-CssClass="s4-breadcrumbNode"
    CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
    RootNodeStyle-CssClass="s4-breadcrumbRootNode"
    HideInteriorRootNodes="true"
    SkipLinkText="" />

share|improve this answer
add comment

Is your aspx page inheriting the master page of the site? In SharePoint Designer 2007, when you'd create a new aspx page, you could go into the Format menu and select Master Page and use the Attach Master Page option.

That should then properly show the breadcrumbs.

share|improve this answer
    
The page has the DynamicMasterPageFile="~masterurl/default.master" attribute set. I've made no changes to the OOTB SharePoint 2010 master pages. –  user2287 Jan 28 '11 at 22:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.