node_preprocess_html

node_preprocess_html(&$variables)

Implements hook_preprocess_HOOK() for HTML document templates.

File

core/modules/node/node.module, line 519
The core module that allows content to be submitted to the site.

Code

function node_preprocess_html(&$variables) {
  // If on an individual node page, add the node type to body classes.
  if (($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof NodeInterface) {
    $variables['node_type'] = $node->getType();
  }
}
doc_Drupal
2016-10-29 09:31:57
Comments
Leave a Comment

Please login to continue.