We help IT Professionals succeed at work.

breadcrumbs

Tom Knowlton
Tom Knowlton asked
on
Are there automated breadcrumb controls or tutorials for making one?

Perhaps something that builds the breadcrumbs based on your browser history?

Is this too problematic?  What are some approaches to making breadcrumbs?  What are the pitfalls?

Thanks!

(asp.net C# / JavaScript / jQuery examples are fine)
Comment
Watch Question

Breadcrumbs are a good way to present hierarchical paths to a node in your site map (or, in other words, a page). The problem that arises when you use browser history (or another history-tracking method, be it session variables or something like that) is that users don't necessarily navigate according to linear paths, and the bread crumb trail can easily get knotted up with itself - consider the following blog navigation experience:

1. User goes to blog home page (no bread crumb)
2. User selects "Tech" category (Breadcrumb: "Tech")
3. User selects "Artificial Intelligence" sub-category ("Tech" > "AI" )
4. User selects an article about fuzzy logic ("Tech" > "AI" > "Fuzzy Logic")
5. User sees another article in a sidebar related to green energy, and clicks on that (Breadcrumb: ???)

At this point, it's not a simple matter of tracking history, because a breadcrumb that reads "Tech" > "AI" > "Fuzzy Logic" > "Green Energy" doesn't make much sense, and isn't very useful. Here, the site needs to be intelligent enough to know how to represent the user's current position in the web of content.

The way you implement a breadcrumb control depends on how you structure your content. The simplest structure to implement is tree-like - each content node has exactly one parent, so no matter where you navigate to in your content, building the breadcrumb is as simple as iterating through the parents of your content nodes. This implies that every content node contains information about who its parent node is (in the aforementioned example, the site "knows" that the parent category to "AI" is "Tech", and that "Fuzzy Logic" belongs in the "AI" sub-category). No information about how the user got there is necessary, since there is only a single path to any destination.

Things become a little more complicated when there are multiple paths to a node. An example of this would be a blog post that you can tag with multiple categories (for instance, consider the case: "Tech > AI > Fuzzy Logic" vs. "Mathematics > Logic > Fuzzy Logic").

There are many prefabricated implementations out there (a Google search for "ASP.NET breadcrumb control" will turn up plenty). This is a good example that tackles these challenges pretty well:

http://www.codeguru.com/vb/vb_internet/aspnet/article.php/c6851
GlobaLevelProgrammer
Commented:
you may be able to hide the breadcrumb....not sure about automated
http://www.sitefinity.com/blogs/ivan/posts/09-02-26/control_panel_automatic_breadcrumb.aspx
Tom KnowltonWeb developer

Author

Commented:
There are many prefabricated implementations out there (a Google search for "ASP.NET breadcrumb control" will turn up plenty). This is a good example that tackles these challenges pretty well:

http://www.codeguru.com/vb/vb_internet/aspnet/article.php/c6851

---------------------------------

I don't suppose there is a C# equivalent.  Not really looking to port code right now....
I don't think there's a c# version of that particular solution, but here's a different one:

http://www.eggheadcafe.com/tutorials/asp-net/4dd2114f-301e-408b-b6a6-e65ff889c3da/creating-breadcrumb-user-control.aspx