Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be great to have a config page/ui to set a breadcrumb separator.
A related issue: #1326740: Customizing breadcrumb separator: 'Array to String Conversion' error
Temporary Template.php solution (replace MYTHEMESNAME with your theme folder name)
function MYTHEMESNAME_delta_blocks_breadcrumb($variables) {
$output = '';
if (!empty($variables['breadcrumb'])) {
if ($variables['breadcrumb_current']) {
$variables['breadcrumb'][] = l(drupal_get_title(), current_path(), array('html' => TRUE));
}
$output = '<div id="breadcrumb" class="clearfix"><ul class="breadcrumb">';
$switch = array('odd' => 'even', 'even' => 'odd');
$zebra = 'even';
$last = count($variables['breadcrumb']) - 1;
foreach ($variables['breadcrumb'] as $key => $item) {
$zebra = $switch[$zebra];
$attributes['class'] = array('depth-' . ($key + 1), $zebra);
if ($key == 0) {
$attributes['class'][] = 'first';
}
if ($key == $last) {
$attributes['class'][] = 'last';
$output .= '<li' . drupal_attributes($attributes) . '>' . $item . '</li>' . '';
}
else {
$output .= '<li' . drupal_attributes($attributes) . $item . ' > </li>';
}
}
$output .= '</ul></div>';
}
if (drupal_is_front_page()) {
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
$output .= '<div class="breadcrumb">Startseite</div>';
}
return $output;
}
Comments
Comment #1
kclarkson CreditAttribution: kclarkson commentedMy problem is that the Delta Block separator does not match the core.
I would like to have the mini >> separators or even add a custom image.
Nothing changes when I add it to the code for the Delta block but the core breadcrumbs do change.
Comment #2
kclarkson CreditAttribution: kclarkson commentedFixed title
Comment #3
Screenack CreditAttribution: Screenack commentedE-anima: this template.php override is great, except that it doesn't add links between the first element in the breadcrumb. Only the last element will have a link. How can I add a link to each breadcrumb element?