Skip to content

Instantly share code, notes, and snippets.

@crisgaret
Last active December 19, 2015 05:39
Show Gist options
  • Select an option

  • Save crisgaret/5906122 to your computer and use it in GitHub Desktop.

Select an option

Save crisgaret/5906122 to your computer and use it in GitHub Desktop.
Add a list structure to Drupal's breadcrumbs, and include the page title. Most of the code is from the Drupal API page.

Add some breadcrumbs

<?php
/* Put Breadcrumbs in a ul li structure */
function THEMENAME_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];
  $title = drupal_set_title();
  if (!empty($breadcrumb)) {
    $crumbs = '<ul >';
    foreach(
      $breadcrumb as $value) {
         $crumbs .= '<li>'.$value.'</li>';
      }
    $crumbs .= '<li class="page-name">' .$title. '</li>';
    $crumbs .= '</ul>';
  }
    return $crumbs;
  }
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment