You are here

function nopremium_preprocess_node in Node Option Premium 8

Implements template_preprocess_node().

File

./nopremium.module, line 205
Hook implementations.

Code

function nopremium_preprocess_node(&$variables) {

  /** @var \Drupal\node\NodeInterface $node */
  $node = $variables['elements']['#node'];
  if (!empty($node->original_view_mode)) {
    if ($node->original_view_mode == 'full' && node_is_page($node)) {

      // If the original view mode was 'full', set the template variable 'page'
      // to TRUE. This ensures that the h2 title is not shown when the default
      // node template is used.
      $variables['page'] = TRUE;
    }
  }
}