0

How can I remove the < from the breadcrumb I tried implode('<', $value['data']) but no luck

   function bootstrap_fit_breadcrumb($variables) {
            $breadcrumb = $variables['breadcrumb'];

            if (!empty($breadcrumb)) {
              //$breadcrumb[] = drupal_get_title();
              $breadcrumbs = '<ul class="breadcrumbs_list">';

              $count = count($breadcrumb) - 1;

              foreach ($breadcrumb as $key => $value) {
                  if ($key==0) {
                    $breadcrumbs .= '<li>' . $value . '</li>';
                  } else {
                   $breadcrumbs .= '<li><span></span>' . $value['data'] . '</li>';

                  }
              }
              $breadcrumbs .= '</ul>';
              return $breadcrumbs;
      }
   }

displaying

Home < Financial Services

3 Answers 3

0

Have you reviewed this page?

https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_breadcrumb/7

Also, what theme are you using? I would check the base theme to make sure that it isn't preprocessing the breadcrumbs itself. If so, you'll need to make sure you are calling the appropriate function in order to override the breadcrumb settings.

1
  • yes that's where I got the implode() method from... but no luck
    – acctman
    Commented Dec 15, 2015 at 18:29
0

Super simple solution: use str_replace. In page.tpl.php replace

print $breadcrumb;

with

print str_replace(" < ", "  ", $breadcrumb);

or

print str_replace(" < ", " > ", $breadcrumb);

NOTE: I assume that '<' is surrounded by specific pattern otherwise str_replace will remove all opening parenthesis of html tags in $breadcrumb variable.

0

Drupal 8: I found a breadcrumb.html.twig file in my theme. The separator was coded into the theme (Businessgroup Zymphonies Theme). After removing it from the template, you can add a custom separator using CSS. Something like this:

.breadcrumb li:not(:last-child):after {
   content: ">"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.