You are here

function menu_get_active_breadcrumb in Drupal 4

Same name and namespace in other branches
  1. 5 includes/menu.inc \menu_get_active_breadcrumb()
  2. 6 includes/menu.inc \menu_get_active_breadcrumb()
  3. 7 includes/menu.inc \menu_get_active_breadcrumb()

Returns an array of rendered menu items in the active breadcrumb trail.

Related topics

1 call to menu_get_active_breadcrumb()
drupal_get_breadcrumb in includes/common.inc
Get the breadcrumb trail for the current page.

File

includes/menu.inc, line 529
API for the Drupal menu system.

Code

function menu_get_active_breadcrumb() {

  // No breadcrumb for the front page.
  if (drupal_is_front_page()) {
    return array();
  }

  // We do *not* want to use "variable_get('site_frontpage', 'node)" here
  // as that will create the link '/node'. This is unsightly and creates
  // a second URL for the homepage ('/' *and* '/node').
  $links[] = l(t('Home'), '');
  $trail = _menu_get_active_trail();
  foreach ($trail as $mid) {
    $item = menu_get_item($mid);
    if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) {
      $links[] = menu_item_link($mid);
    }
  }

  // The last item in the trail is the page title; don't display it here.
  array_pop($links);
  return $links;
}