2

I have been trying to display the menu item title as the trailing item in my breadcrumbs, other than the page title.

At this point, I override the template_breadcrumb() function with a custom function. At the end of the string variable, I have put drupal_get_title() to append the page title to the breadcrumb trail.

Please find a snippet out of the breadcrumb function below:

foreach($breadcrumb as $value) {
  $crumbs .= $value;
}
$crumbs .= drupal_get_title();

Now, when available, I would prefer the linked navigation item title to be displayed as trailing breadcrumb item. If not available, I will display the page title.

How can I check if this page is attached to a menu item, and retrieve the title, in order to display it as a breadcrumb item ?

2 Answers 2

1

You can use Crumbs module. In the configuration (Admin > Structure > Crumbs), look for

menu.link_title.*
menu.link_title.devel      - Development
menu.link_title.main-menu  - Main menu
menu.link_title.management - Management
menu.link_title.navigation - Navigation
menu.link_title.user-menu  - User menu

This is already enabled by default. To disable it for specific menus, move the respective line into the "disabled" section.

1

Perhaps you could look at this module: http://drupal.org/project/menu_breadcrumb It sounds perfect for your needs.

Some details from the module's project page:

By default, Drupal 6+ use the Navigation menu for the breadcrumb. This module allows you to use the menu the current page belongs to for the breadcrumb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.