template.php breadcrumb function I'm trying to change the breadcrumb in Drupal to display in Danish through the template.php in my theme, but I cannot change it. I've flushed the cache.

This is what I've put in the template.php.

  function modeindeks_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 = '&lt;h2 class="polle"&gt;' . t('Du er her') . '&lt;/h2&gt;';

      $output .= '&lt;div class="breadcrumb"&gt;' . implode(' › ', $breadcrumb) . '&lt;/div&gt;';
      return $output;
     }
    }
Breadcrumb is made up of an array. So to add any element in the breadcrumb you have to give the offset.

So if you want to set t('Du er her') in place of the front page link then you should try this:

$breadcrumb[0] = l(t('Du er her'), 'front');


To know the exact position of element which do you want to add, you can use var_dump($breadcrumb).

I would rewrite the code as follows.

function modeindeks_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.
    // Instead of front, you can use the URL of your site's front page.
    $breadcrumb[0] = l(t('Du er her'), 'front'); 

    $output .= '&lt;div class="breadcrumb"&gt;' . implode(' › ', $breadcrumb) . '&lt;/div&gt;';

    return $output;
  }
}


If you want to add only You are here link then use the below code.

function modeindeks_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return '&lt;div class="breadcrumb"&gt;You are here: ' . implode(' › ', $breadcrumb) . '&lt;/div&gt;';
  }
}