Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove HOME from breadcrumb

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

like image 978
canintex Avatar asked Aug 26 '10 21:08

canintex


People also ask

How do I turn off breadcrumbs navigation?

Follow the steps below: From your WordPress Dashboard, go to Appearance > Customize > Content > Page Header section. Switch off the Enable Breadcrumbs option to remove it.


2 Answers

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;
  }
}
like image 136
neochief Avatar answered Sep 21 '22 17:09

neochief


Override the breadcrumb in your theme's template.php file:

/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    array_shift($breadcrumb); // Removes the Home item
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}
like image 29
scronide Avatar answered Sep 19 '22 17:09

scronide