Last active
November 11, 2020 01:13
-
-
Save robdecker/9119104 to your computer and use it in GitHub Desktop.
[Create custom breadcrumbs for views] #d7
This file contains 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
/** | |
* Implements hook_views_pre_render(). | |
*/ | |
function HOOK_views_pre_render(&$view) { | |
if ($view->name == 'NAME') { | |
$breadcrumb = array(); | |
$breadcrumb[] = l(t('Home'), '<front>'); | |
$breadcrumb[] = l(drupal_get_title(), current_path()); | |
drupal_set_breadcrumb($breadcrumb); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! The only possible issue I'm seeing is:
$breadcrumb[] = l(drupal_get_title(), current_path());
In that Drupal already appends the breadcrumb for the current page, so I've just nixed that line.