465a12a1f4c4a365680e7006edb93d8539f10d6f
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / entity_view_alter.twig
1 /**
2  * Implements hook_entity_view_alter().
3  */
4 function {{ machine_name }}_entity_view_alter(&$build, $type) {
5   if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
6     // Change its weight.
7     $build['an_additional_field']['#weight'] = -10;
8
9     // Add a #post_render callback to act on the rendered HTML of the entity.
10     $build['#post_render'][] = 'my_module_node_post_render';
11   }
12 }