--- menu_breadcrumb.module.old 2012-02-25 09:34:23.223954911 -0500 +++ menu_breadcrumb.module.new 2012-02-25 09:37:23.408848396 -0500 @@ -290,6 +290,22 @@ } /** + * Implementation of hook_menu_breadcrumb_alter(). + * + * Alter links in the active trail before it is rendered as the breadcrumb. + */ +function menu_breadcrumb_menu_breadcrumb_alter(&$active_trail, $item) { + + // Removes double leading "Home" link when a menu top item links to the front page. + if (variable_get('menu_breadcrumb_single_home_link', FALSE) + && isset($active_trail[0]) && isset($active_trail[1]) + && $active_trail[0]['href'] === '' && $active_trail[1]['href'] === '') { + // Shift array to remove exceding "home" link + array_shift($active_trail); + } +} + +/** * Implementation of hook_init(). * * Set the active menu according to the current path. @@ -386,6 +402,13 @@ '#default_value' => variable_get('menu_breadcrumb_hide_on_single_item', 0), ); + $form['menu_breadcrumb_single_home_link'] = array( + '#type' => 'checkbox', + '#title' => t('Remove double leading "Home" links.'), + '#description' => t('Removes double leading "Home" link when a menu top item links to the front page.'), + '#default_value' => variable_get('menu_breadcrumb_single_home_link', 0), + ); + $form['include_exclude'] = array( '#type' => 'fieldset', '#title' => t('Enable / Disable Menus'),