Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#1 | menu_breadcrumb_7.x-1.3_remove_duplicate_home_links.patch | 1.33 KB | mesr01 |
menu_breadcrumb_7.x-1.3_remove_duplicate_home_links.diff | 1.4 KB | mesr01 |
Comments
Comment #1
mesr01 CreditAttribution: mesr01 commentedPrevious patch will fail because there is an error in the diff header. Here's the corrected version. Content is exact same.
Comment #2
vaibhavjainmesr01,
In your code below
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)
Comments and suggestions welcomed.
Comment #3
xurizaemonRather 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.Comment #4
vaibhavjaingrobot,
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.
Comment #5
vaibhavjainI 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.
Comment #6
vaibhavjainComment #7
nicxvan CreditAttribution: nicxvan commentedThis is also an issue in D8 with multilingual sites. Is the solution similar to the solution in this patch?
Comment #8
xurizaemonClosing a lot of ancient (> 4 years) issues. It's fine to re-open if you think there's something of value to be discussed.