You are here

function html_title_node_view in HTML Title 8

Same name and namespace in other branches
  1. 7 html_title.module \html_title_node_view()

Implements hook_ENTITY_TYPE_view().

File

./html_title.module, line 112
HTML Title module to enable limited HTML tags in title.

Code

function html_title_node_view(array &$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode) {
  if (isset($build['title'][0]['#context']['value'])) {
    $build['title'][0]['#context']['value'] = \Drupal::service('html_title.filter')
      ->decodeToMarkup($build['title']);
  }
}