Created
January 25, 2017 10:49
-
-
Save martsie/c3212ad7fda42f7fdd369bbfb7ec50fa to your computer and use it in GitHub Desktop.
Overriding breadcrumbs in Drupal 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_awesome_theme_breadcrumb($variables) { | |
$breadcrumb = $variables['breadcrumb']; | |
if (!empty($breadcrumb)) { | |
// Provide a navigational heading to give context for breadcrumb links to | |
// screen-reader users. Make the heading invisible with .element-invisible. | |
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>'; | |
// Add 'my-awesome-class' to the breadcrumb wrapper and change the separators from '»' to '::'. | |
$output .= '<div class="breadcrumb my-awesome-class">' . implode(' :: ', $breadcrumb) . '</div>'; | |
return $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment