node_entity_view_display_alter(EntityViewDisplayInterface $display, $context)
Implements hook_entity_view_display_alter().
function node_entity_view_display_alter(EntityViewDisplayInterface $display, $context) { if ($context['entity_type'] == 'node') { // Hide field labels in search index. if ($context['view_mode'] == 'search_index') { foreach ($display->getComponents() as $name => $options) { if (isset($options['label'])) { $options['label'] = 'hidden'; $display->setComponent($name, $options); } } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!node!node.module/function/node_entity_view_display_alter/8.1.x