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.
I ran into an issue where setting breadcrumbs on Views pages (using custom breadcrumbs module) appended an empty separator to the breadcrumb.
I added a simple if/then statement to remove the separator when a title is empty. More details and code can be found here: http://drupal.org/node/581666
Here's the section specifically that I modified.
// Return the breadcrumb with separators.
if (!empty($breadcrumb)) {
$breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
$trailing_separator = $title = '';
if (theme_get_setting('zen_breadcrumb_title')) {
$trailing_separator = $breadcrumb_separator;
$title = menu_get_active_title();
//Check for empty title and kill separator if necessary.
if($title == ''){
$trailing_separator = '';
}
}
elseif (theme_get_setting('zen_breadcrumb_trailing')) {
$trailing_separator = $breadcrumb_separator;
}
return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>";
}
Comments
Comment #1
JohnAlbinGood catch!
I used a slightly more optimized approach, but I'll credit you with the fix in CHANGELOG.txt. :-)
Fixed in 6.x-1.x and 6.x-2.x.