How do I remove HOME from breadcrumb

canintex picture canintex · Aug 26, 2010 · Viewed 10.6k times · Source

I am using Drupal 6.17 and want to get rid of "HOME" in the breadcrumb output...

eg:

$breadcrumb= PRODUCTS // SOFTWARE // FEATURES

instead of

HOME // PRODUCTS // SOFTWARE // FEATURES

Answer

neochief picture neochief · Feb 15, 2012

Here's a Drupal 7 version:

/**
 * Get rid of Home in breadcrumb trail.
 */
function <themename>_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    array_shift($breadcrumb); // Removes the Home item
    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    return $output;
  }
}