You are here

function smart_title_node_view_alter in Smart Title 8

Implements hook_ENTITY_TYPE_view_alter() for node.

File

./smart_title.module, line 162
Contains hooks and private functions of smart_title.module.

Code

function smart_title_node_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
  foreach (_smart_title_view_configurable_base_fields('node') as $base_field_name) {
    if (!empty($build[$base_field_name])) {

      // Create a shadow copy of these base fields. template_preprocess_node()
      // removes the original output of these field and we won't be able to get
      // them on render.
      $build["smart__temp_{$base_field_name}"] = $build[$base_field_name];
    }
  }
}