How do I modify the text on a breadcrumb?

Is there a way to hook this generically so that I can change the text of any breadcrumb that is shown, regardless of the page?


See How to get rid of the "/blog"-page that displays all user-blogs (or change the breadcrumb-link)? I think that you will find an example on how to change a specific text of your breadcrumb.

For example, in your template.php file you can use phptemplate_breadcrumb() to search and replace text:

function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    $breadcrumb = preg_replace("/old text/", "new text", $breadcrumb); // This line will search and replace text.
    return '<div class="breadcrumb">'. implode(' >> ', $breadcrumb) . '</div>';

I have used the Custom Breadcrumbs module on a number of projects. If you have the Pathauto module and consistent/clean URL aliases you can define the rules based on your address in the URL.

  • Does this also work for Views with contextual filters? – beth Jul 9 '12 at 15:34
  • Yes it would work on views with contextual filters. – 15dk51 Jul 15 '12 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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