This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/chi-teck/drupal-code-generator/templates/d7/hook/view.twig
2018-11-23 12:29:20 +00:00

20 lines
527 B
Twig

/**
* Implements hook_view().
*/
function {{ machine_name }}_view($node, $view_mode, $langcode = NULL) {
if ($view_mode == 'full' && node_is_page($node)) {
$breadcrumb = array();
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb[] = l(t('Example'), 'example');
$breadcrumb[] = l($node->field1, 'example/' . $node->field1);
drupal_set_breadcrumb($breadcrumb);
}
$node->content['myfield'] = array(
'#markup' => theme('mymodule_myfield', $node->myfield),
'#weight' => 1,
);
return $node;
}