4.6.x common.inc drupal_set_breadcrumb($breadcrumb = NULL)
4.7.x common.inc drupal_set_breadcrumb($breadcrumb = NULL)
5.x common.inc drupal_set_breadcrumb($breadcrumb = NULL)
6.x common.inc drupal_set_breadcrumb($breadcrumb = NULL)
7.x common.inc drupal_set_breadcrumb($breadcrumb = NULL)

Set the breadcrumb trail for the current page.


$breadcrumb: Array of links, starting with "home" and proceeding up to but not including the current page.

5 calls to drupal_set_breadcrumb()
blog_view in modules/blog/blog.module
Implementation of hook_view().
comment_reply in modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
drupal_get_breadcrumb in includes/common.inc
Get the breadcrumb trail for the current page.
hook_view in developer/hooks/node.php
Display a node.
template_preprocess_forums in modules/forum/forum.module
Process variables for forums.tpl.php


includes/common.inc, line 89
Common functions that many Drupal modules will need to reference.


function drupal_set_breadcrumb($breadcrumb = NULL) {
  static $stored_breadcrumb;
  if (!is_null($breadcrumb)) {
    $stored_breadcrumb = $breadcrumb;
  return $stored_breadcrumb;


mikeytown2’s picture

// Build Breadcrumbs
$breadcrumb = array();
$breadcrumb[] = l('Home', '');
$breadcrumb[] = l('Topics', 'taxonomy/term/1');
$breadcrumb[] = l(drupal_get_title(), base_path() . request_uri()); // Link to current URL

// Set Breadcrumbs
Xano’s picture

Make sure you run the link text through t() before setting the breadcrumb.

KingMoore’s picture

Beware if you do not check 'Show home page link in breadcrumb' in your theme configuration under the breadcrumb settings, then the first element in your $breadcrumb array sent to drupal_set_breadcrumb will not be shown (ie. the first element is what drupal considers the home link on the theme config page).