Hi,

What's the best way to change the 'home' text in the breadcrumb in both the Drupal 6 and 7 versions of this theme?

Thanks for any help.

Comments

maximer’s picture

Hi,

you can change the theme_breadcrumb() function in the template.php file to this:

function bigdaddy_breadcrumb($breadcrumb) {
	
  if (!empty($breadcrumb)) {
    $crumbs = '<ul class="breadcrumb">';
    $array_size = count($breadcrumb);
    $i = 0;
    while ($i < $array_size) {
      if ($i == 0) {
        $crumbs .= '<li>' . l('My new home', '<front>') . ' > </li>';
      }
      else {
        $crumbs .= '<li>' . $breadcrumb[$i] . ' > </li>';   
      }
      $i++;
    }
    $crumbs .= '<li class="current-page">'. drupal_get_title() .'</span></ul>';
    return $crumbs;
  }
  
}

=> It's the same function and modification in D7.

Jboo’s picture

Status: Active » Fixed

Thanks very much for your help, works perfectly, much appreciated.

maximer’s picture

Status: Fixed » Closed (fixed)

You're welcome ;)
Just saw your website http://www.bedsforhome.com/. Looks really clean!

Jboo’s picture

Thanks! It's just undergone a redesign but there are some finishing touches I need to do, plus content redevelopment. I appreciate the feedback! Thanks again.

bhavikshah9’s picture

Issue summary: View changes

@maximar
Thanks a lot. Your comment has helped me very much.

supriyarajgopal’s picture

Hello,

Including a single line of code in theme_breadcrumb() in template.php can help achieve custom link to 'Home' in the breadcrumb:

function responsive_business_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];
  if (!empty($breadcrumb)) {
    // Use CSS to hide titile .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
    // comment below line to hide current page to breadcrumb
	$breadcrumb[] = drupal_get_title();
        //Add this line to replace the link to custom URL
	$breadcrumb[0] = l('Home', '<relative custom URL>');
    $output .= '<nav class="breadcrumb">' . implode(' » ', $breadcrumb) . '</nav>';
    return $output;
  }
}

Hope this helps.