Some sites have a link in the main menu pointing to the home page. This patch implements hook_menu_breadcrumb_alter() to remove the leading "Home" link in that case (with a new admin setting in case you don't want to activate it).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mesr01’s picture

Previous patch will fail because there is an error in the diff header. Here's the corrected version. Content is exact same.

vaibhavjain’s picture

mesr01,

In your code below

if (variable_get('menu_breadcrumb_single_home_link', FALSE)
      && isset($active_trail[0]) && isset($active_trail[1])
      && $active_trail[0]['href'] === '<front>' && $active_trail[1]['href'] === '<front>')

We can modify this patch and come up with a new functionality.
If a user wants to remove the home link/text from the breadcrumb, then via this they can remove it completely, even if the link does not exists in the main menu. (More flexibility)

if (variable_get('menu_breadcrumb_single_home_link', FALSE)
      && isset($active_trail[0]) && $active_trail[0]['href'] === '<front>')

Comments and suggestions welcomed.

xurizaemon’s picture

Rather than special casing for <front>, why don't we (optionally, or per default) reduce duplicates once we've generated the breadcrumb? That would seem more sensible. I imagine lots of sites already have Home > ViewA > ViewA+Filter > Node structures, this might be beneficial for that case too.

vaibhavjain’s picture

grobot,

Yes we can, we can provide an admin option to remove any possible duplicates.
Apart from that I am thinking about adding an option to remove the "HOME" link from the menu.

vaibhavjain’s picture

I have added the option to remove the Home / link to front page.
It is in dev mode, if required, please test it and let me know if you face any issues.
I will then work on adding a check for removing duplicate enteries from the Breadcrumb.

vaibhavjain’s picture

Assigned: mesr01 » vaibhavjain
Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Needs work
nicxvan’s picture

This is also an issue in D8 with multilingual sites. Is the solution similar to the solution in this patch?

xurizaemon’s picture

Status: Needs work » Closed (outdated)

Closing a lot of ancient (> 4 years) issues. It's fine to re-open if you think there's something of value to be discussed.