df86471354205bde75352bea806dd5b04208ee85
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_display_alter.twig
1 /**
2  * Implements hook_field_display_alter().
3  */
4 function {{ machine_name }}_field_display_alter(&$display, $context) {
5   // Leave field labels out of the search index.
6   // Note: The check against $context['entity_type'] == 'node' could be avoided
7   // by using hook_field_display_node_alter() instead of
8   // hook_field_display_alter(), resulting in less function calls when
9   // rendering non-node entities.
10   if ($context['entity_type'] == 'node' && $context['view_mode'] == 'search_index') {
11     $display['label'] = 'hidden';
12   }
13 }