Is it possible to have breadcrumbs displayed based on the path the user chose to reach a content?

If i have a node that can be navigated to by two different menu paths like so

home->articles->node1
home-> featured articles ->node1

Basically depending on where the user came from I'd want the breadcrumbs shown to allow them to effectively go back up the same path... is this doable with custom crumbs?

Comments

MGN’s picture

It is with the custom_breadcrumbs_paths module in the 6.x-2.x-dev version.

MGN’s picture

Title: Referal path based breadcrumbs? » Are path based breadcrumbs possible?
Version: 6.x-1.4 » 6.x-2.x-dev
Status: Active » Fixed
david1409’s picture

Hi,

This is exactly what I'm trying to do and I'm really pleased to see that it can be done. Can you please give a few more details as to how, I have spent several hours trying and failing. Is there any documentation I can read?

Currently I have a "welcome" screen, which leads to two index pages, one in English one in French and below each of these the several pages of content itself. I also have a site wide contact form which is language neutral and accessable from all pages except the "welcome" screen with a further link to a map. There are two pages a "Live Chat" and "about" page which are language specific (so really four pages) and only available from pages in the language or language neutral. Pathauto is installed. Currently everypage I go to only has one breadcrumb "Home" and it always points back to the "welcome" screen.

What I idealy want is to use either of the index pages as the "Home" crumb and from there have the crumbs display the path followed but so long I can just display the path I'd be happy.

Honest I don't expect anybody to do this for me or I'd never learn anything but please can somebody point me in the right direction.

Dave

MGN’s picture

Hi Dave,

I've just updated the documentation to describe the new 6.x-2.x features. There is a link to the custom breadcrumbs documentation on the project page http://drupal.org/project/custom_breadcrumbs. Hopefully that will be helpful, if not, please share your questions and suggestions for improving the documentation.

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

navneet.rawal’s picture

Component: Code » custom_breadcrumbs_paths
Status: Closed (fixed) » Active

Hi MGN,

You've built a great module! However, I am trying to do the same thing and don't seem to understand how this would be possible in custom breadcrumbs paths module

For example, I reach a Whitepaper page by say two paths:

1) Home->Technology->Cybersecurity->Whitepaper List->Sample Whitepaper

2) Home ->Brands->Google->Whitepaper List->Sample Whitepaper

The URL of the Sample Whitepaper is fixed (same, no matter where you come from. so it does not have technology/brand parameters in the url), say, in the form www.example.com/library/whitepapers/sample-whitepaper

Is it possible to have the corresponding breadcrumb for the Sample Whitepaper page according to the path that was taken to reach it?

MGN’s picture

Status: Active » Postponed (maintainer needs more info)

This sounds like history-based breadcrumbs that shows the users the path they took (ala Hansel-and-Gretel) to get to the destination. Is that what you are after? History-based breadcrumbs aren't currently implemented in the module, but it wouldn't be hard to add this as a feature request. I thought about doing this a while back but decided it wasn't worthwhile since the browser back button (or history) accomplishes the same task. Perhaps there is another reason why this approach is valuable? Or maybe I am misunderstanding the use case?

navneet.rawal’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, that's exactly what I was saying. Wikipedia says something similar for path-based breadcrumbs: "# Path: path breadcrumbs are dynamic and show the path that the user has taken to arrive at a page."

In a website with deep levels of content, the user might feel lost if he doesn't see a visual trail of where he is in the website and how he got to that page.
Another big reason in favor of this is if the content can be classified under more than one categories, then location-based breadcrumbs will be misleading to the user.

If I elucidate my previous example:

1) Home->Technology->Cybersecurity->Cybersecurity Whitepaper List->Sample Whitepaper

2) Home ->Brands->Google->Google Whitepaper List->Sample Whitepaper

When the user goes to the Sample Whitepaper page and the breadcrumb is location-based, how will the breadcrumb show different trails if the user came to the page through the Google Whitepaper list, or the Cybersecurity whitepaper list? If the breadcrumb shows only one trail for both, I would think it would be very confusing to the user and he would feel "lost" in the website.

The history-based breadcrumb seems to me a useful add on to the custom breadcrumb family.

MGN’s picture

Title: Are path based breadcrumbs possible? » Are history based breadcrumbs possible?
Category: support » feature
Status: Active » Postponed (maintainer needs more info)

Ok, changing the title to reflect the new thread.

Although I think the relative merit of history-based breadcrumbs can be debated (see http://www.useit.com/alertbox/breadcrumbs.html for counter arguments), but lets put that aside and assume this is a worthwhile addition to Drupal. I guess one should start by making sure it isn't already provided in another contrib module. If its not...

Should it be part of custom breadcrumbs or a separate module?

It would not be difficult to add an option to do this in custom breadcrumbs. But since the rest of custom breadcrumbs is location based, I am not sure it would enhance the current package. Why not just do a separate history-breadcrumbs module?

Other things to consider...

I expect we will limit the number of levels in the history to a reasonable number, but what should it be?

Should we always show a home crumb? or just the n most recent crumbs?

Is it correct to assume the breadcrumb title should be the page title? A simple implementation would not even need to save or retrieve information from the database...

The formatting can always be done at the theme level, custom breadcrumbs just needs to determine what the crumbs should be in the breadcrumb array.

navneet.rawal’s picture

Status: Postponed (maintainer needs more info) » Active

Looking at your questions and keeping in mind the counter arguments of history-based breadcrumbs but yet their utility, perhaps we could merge both location-based and path-based breadcrumbs to get the best of both worlds:

1) By default, all breadcrumbs should be location-based.
2) Set history-based breadcrumbs for only those pages which have been explicitly specified. The pages which lie under multiple categories (and hence the need for history-based breadcrumbs) would be specified here.

In other words, history-based breadcrumbs would work only for those pages which have been explicitly specified. For all other pages, location-based breadcrumbs should suffice.

Example:
Say the page we want to have the history-based breadcrumbs is the Sample whitepaper page from my previous example. Sample whitepaper page could be accessed from 2 paths:

1) Home->Technology->Cybersecurity->Cybersecurity Whitepaper List->Sample Whitepaper
2) Home ->Brands->Google->Google Whitepaper List->Sample Whitepaper

(I could be wrong) One way of implementing the (lets say) "dual breadcrumbs" would be to check from which page the user went to the Sample Whitepaper page. On the breadcrumb for the Sample Whitepaper page, the title of the calling page will simply be appended to the breadcrumb of the calling page.
Since it is checking only the calling page, only 1 level in history is needed.
Worrying about the home crumb does not apply in this case because it would show (or not) depending on the crumb of the calling page.

Now in order for the system to know which pages to check (and store in history) that lead to the Sample Whitepaper page, we could add a multiple value 'Referring Page URL' field in the 'Create Dual Breadcrumb' admin section.

Hopefully, this will be helpful.

MGN’s picture

Category: feature » support
Status: Active » Postponed (maintainer needs more info)

Have you looked at the clickpath module. It looks like this would work for you. Let me know what you think - no reason to duplicate efforts if we can avoid it.

MGN’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

closing because the question has been answered.