Breadcrumb Path Separator and Path Direction

There are several settings you can apply to breadcrumbs in MOSS, although really some of these are really ASP.NET settings rather than most specific. Previously I’ve mentioned using different SiteMapProviders and rendering the current location as a link. Let’s have a look at another couple of settings:

Examples of various breadcrumb settings and different SiteMapProvider's output

(Yes, this screenshot shows some other settings – they’re mentioned in the other articles)

Looking at the screenshot we can see how the Path Separator setting allows us to set what we want shown between nodes – rather than ” > ” I’ve used “:”. Not sure when/why you’d want to change that, but I’m sure I’ll be given a design where that is useful sometime!

There’s also the Path Direction setting, which allows us to set whether the breadcrumb should have the current node on the left or right of the breadcrumb – hence the two settings, RootToCurrent and CurrentToRoot. Note, though, that the default path separator doesn’t swap from ” > ” to ” < “.

Advertisements
Breadcrumb Path Separator and Path Direction

2 thoughts on “Breadcrumb Path Separator and Path Direction

  1. Neeraj says:

    Andy,
    Thanks for this great post. I appreciate putting things together for others to find a solution for their problems.
    I have ran into these two requirement :
    #1. I need to replace the path separator “>” with this ” – “, including a space before and after the hyphen, but definitely without the double-quotes 🙂
    It seems like you have done that, but can you please let me know how you did that.

    #2 The other need is to have some of my pages on a MOSS publishing site override this breadcrumb, so that we can customize the breadcrumb display text.
    An eg. to illustrate:
    Currently: “Home – Product Category” and “Home – Product Detail”
    As I have just two levels of site hierarchy, top is the home page and second level is the Product categary and Product Detail page (These two pages are at same level). So navigating to any of them interchanges the two breadcrumbs above.

    Future Requirement: “Home – Product Category – Product Detail – Part No – Item No”

    I understand that this would be possible by having pages at 5 different levels.
    But I repeat, I have just two levels of site hierarchy, top is the home page and second level is the Product categary and Product Detail page (So these two pages are at same level)
    Any thoughts or suggestions.
    Thanks in advance.
    Neeraj.

    Like

  2. Hi Neeraj,

    Hehe, yes, I probably wasn’t explicit enough – the ASP:SiteMapPath control on your page can have an attribute ‘PathSeparator’. You’ll want to set it to ‘ – ‘. Thus, it’d look something like:

    (I’ve snipped the middle, a bit too much code there, and your page/master page should have it already!)

    Regarding point #2 – yes, not an uncommon requirement, actually. Unfortunately, SharePoint doesn’t deal with this well out of the box. I’ve blogged about my musing on this a bit before:

    http://www.novolocus.com/2008/04/11/folder-based-navigation-in-sharepoint/

    The short answer is that to avoid having 5 different levels, you probably need a custom navigation provider. Creating one is a development task (it’s not something you can do through SharePoint Designer!)

    I’ve linked to some information about doing this here:

    http://www.novolocus.com/2008/07/29/creating-a-sitemapprovider-for-sharepoint/

    Like

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 )

Google+ photo

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

Connecting to %s