Skip to content

Instantly share code, notes, and snippets.

View andydempster's full-sized avatar
💬

Andy Dempster andydempster

💬
View GitHub Profile
@robdecker
robdecker / any.php
Last active November 11, 2020 01:14
[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);
}
@robdecker
robdecker / any.php
Last active November 11, 2020 01:13
[Create custom breadcrumbs for views] #d7
/**
* 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);
}