You are here

function crumbs_theme_breadcrumb in Crumbs, the Breadcrumbs suite 7.2

Replacement theme callback for theme('breadcrumb').

Parameters

$variables:

Return value

string|null Rendered breadcrumb HTML

1 string reference to 'crumbs_theme_breadcrumb'
crumbs_theme_registry_alter in ./crumbs.info.inc
Implements hook_theme_registry_alter()

File

./crumbs.theme.inc, line 10

Code

function crumbs_theme_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];
  if (empty($breadcrumb)) {
    return NULL;
  }

  // These settings may be missing, if theme('breadcrumb') is called from
  // somewhere outside of Crumbs, or if another module is messing with the theme
  // registry.
  $variables += array(
    'crumbs_trailing_separator' => FALSE,
    'crumbs_separator' => ' » ',
    'crumbs_separator_span' => FALSE,
  );
  $separator = $variables['crumbs_separator'];
  if ($variables['crumbs_separator_span']) {
    $separator = '<span class="crumbs-separator">' . $separator . '</span>';
  }
  $output = implode($separator, $breadcrumb);
  if ($variables['crumbs_trailing_separator']) {
    $output .= $separator;
  }
  $output = '<div class="breadcrumb">' . $output . '</div>';

  // Provide a navigational heading to give context for breadcrumb links to
  // screen-reader users. Make the heading invisible with .element-invisible.
  return '<h2 class="element-invisible">' . t('You are here') . '</h2>' . $output;
}