function bootstrap_breadcrumb

7.x-3.x breadcrumb.func.php bootstrap_breadcrumb(array $variables)

Returns HTML for a breadcrumb trail.

Parameters

array $variables: An associative array containing:

  • breadcrumb: An array containing the breadcrumb links.

Return value

string The constructed HTML.

See Also

Related topics

Source templates/system/breadcrumb.func.php (line 22)

function bootstrap_breadcrumb(array $variables) {
  // Use the Path Breadcrumbs theme function if it should be used instead.
  if (_bootstrap_use_path_breadcrumbs()) {
    return path_breadcrumbs_breadcrumb($variables);
  }

  $output = '';
  $breadcrumb = $variables['breadcrumb'];

  // Determine if we are to display the breadcrumb.
  $bootstrap_breadcrumb = bootstrap_setting('breadcrumb');
  if (($bootstrap_breadcrumb == 1 || ($bootstrap_breadcrumb == 2 && arg(0) == 'admin')) && !empty($breadcrumb)) {
    $build = array(
      '#theme' => 'item_list__breadcrumb',
      '#attributes' => array(
        'class' => array('breadcrumb'),
      ),
      '#items' => $breadcrumb,
      '#type' => 'ol',
    );
    $output = drupal_render($build);
  }
  return $output;
}