I love bread crumbs and it figured there had to be a way to do them. Fortunately, bread crumb navigation is one of the objects that comes pre-built in .NET, all you have to do is drop a SiteMapPath control where you want the bread crumbs to show up and draw the website structure from a site map.
SiteMapPath - First Attempt
Site maps serve many purposes but the reason that drew me to it was implementing bread crumbs. Bread crumb navigation is exceptionally handy because not only does it give you a way to navigate around the site via links, but it identifies where you are. So even if the user never clicks the control, it still helps to orient visitors to the site and the page that they are on. Two user interface hits for the price of one.
Now we already have a site map up and working. So it's not a question of knowing how to do it. In fact in development, the site map for this Beta site is up and running. The problem is that there are several sites that have to work together. In ASP.NET, it's quite easy to run multiple site maps for different sites. You just have to configure the web.config file for the root directory. No problem, we tracked down the correct syntax, added the code to our web.config, and tried a couple demos on our home boxes using Visual Web Developer (VWD) Express and IIS. No problems. The next step, clearly, was to upload everything to the live server. Problems.
So we checked with our web host. The answer came back... oh, yeah that should work. Hmmmmmm... We'll get back to you. So at some point in the hopefully near future, we'll be able to assist you with a bread crumb navigation bar. Stay tuned.
Skip to Main Points
DOOM
Well, I certainly didn't think things would work out like this. I took the opportunity to investigate and play with the site map a bit further. I needed to answer some questions for a web application at work. So although the sitemap and breadcrumbs work fine on my development box, this is the first time I've really tried to push it. The web.sitemap file will not support multiple entries for the same page. Really basically, one of the absolute givens for Earth Chronicle is that a file, let's say a homepage on the Mughal dynasty, should be accessible from the Renaissance history menu OR the history of India menu. If you try to list it under both in the sitemap file, ASP.NET no longer displays your page but tells you there's an error in your sitemap. You can only reference a particular path ONCE. So we're done with the web.sitemap, just like that. I'll have to create something that permits similar functionality but with a more advanced and complex sitemap. Multiple references is probably just one feature that we want to incorporate, but it's a clear deal breaker. So back to the drawing board!
[chroniclemaster1, 2008/07/18]
Skip to Main Points