annotate vendor/chi-teck/drupal-code-generator/templates/d7/hook/view.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 /**
Chris@0 2 * Implements hook_view().
Chris@0 3 */
Chris@0 4 function {{ machine_name }}_view($node, $view_mode, $langcode = NULL) {
Chris@0 5 if ($view_mode == 'full' && node_is_page($node)) {
Chris@0 6 $breadcrumb = array();
Chris@0 7 $breadcrumb[] = l(t('Home'), NULL);
Chris@0 8 $breadcrumb[] = l(t('Example'), 'example');
Chris@0 9 $breadcrumb[] = l($node->field1, 'example/' . $node->field1);
Chris@0 10 drupal_set_breadcrumb($breadcrumb);
Chris@0 11 }
Chris@0 12
Chris@0 13 $node->content['myfield'] = array(
Chris@0 14 '#markup' => theme('mymodule_myfield', $node->myfield),
Chris@0 15 '#weight' => 1,
Chris@0 16 );
Chris@0 17
Chris@0 18 return $node;
Chris@0 19 }