Whenever we need to write an aspx page that needs to be invoked in the context of a sharepoint site, we can put them in the ‘_layouts’ virtual.To make the page look like the other sharepoint ‘_layouts’ pages (e.g. Site Settings etc), our custom aspx page will need to use the master page just like the other pages. The master page that we need is "application.master" which is defined as the aspx page attribute MasterPageFile="~/_layouts/application.master" and exists in the ‘layouts’ directory. Since in this post, we are focusing on the breadcrumb show up for our page, let’s take a look at how that works. The application.master page actually contains the breadcrumb control defined in it’s body as:
<asp:SiteMapPath SiteMapProvider="SPXmlContentMapProvider" id="ContentMap" SkipLinkText="" runat="server"/>
Application Modernization Industry Quick Guides
Application modernization enables you to optimize business processes and transform the way you do business today, and in the future. Our industry experts have collected the latest application modernization trends impacting the automotive, financial services, healthcare, and manufacturing verticals.
When you look at the above, it indicates that it uses the ASP.NET 2.0 provider mechanism (specifically the sitemap provider) to create the breadcrumb. It also suggests the type (XML) of storage that this provider probably uses. The XML file we are looking for is in the "C:InetpubwwwrootwssVirtualDirectories<site dir>_app_bin" directory. The file ‘layouts.sitemap’ which resides in this directory contains the breadcrumb information we need for the files in the layouts directory.
The file consists of a hierarchical structure made up of ‘sitemapnode’ XML nodes. A typical sitemapnode node looks like this:
<siteMapNode title="<custom breadcrumb name>" url="/_layouts/<aspxfilename>" />
All we need to do now is to add our own ‘sitemapnode’ in the spot we need in the hierarchy. Next time you hit your page, you should see the breadcrumb show up.