Skip to content

Instantly share code, notes, and snippets.

@robdecker
Last active November 11, 2020 01:14
Show Gist options
  • Save robdecker/9118730 to your computer and use it in GitHub Desktop.
Save robdecker/9118730 to your computer and use it in GitHub Desktop.
[Create custom breadcrumbs for nodes] #d7
/**
* Implements hook_node_view().
*/
function HOOK_node_view($node, $view_mode, $langcode) {
if ($node->type == 'TYPE') {
$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