37 lines
752 B
PHP
37 lines
752 B
PHP
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Functions to support theming in the reha theme.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK() for html.html.twig.
|
|
*/
|
|
function reha_preprocess_html(&$variables) {
|
|
$node = \Drupal::routeMatch()->getParameter('node');
|
|
if ($node){
|
|
$variables['attributes']['class'][] = 'node-type-' . $node->bundle();
|
|
$variables['attributes']['class'][] = 'node-id-' . $node->id();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK() for page.html.twig.
|
|
*/
|
|
function reha_preprocess_page(&$variables) {
|
|
|
|
}
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK() for node.html.twig.
|
|
*/
|
|
function reha_preprocess_node(&$variables) {
|
|
$node = &$variables['node'];
|
|
$variables['attributes']['class'][] = 'node-type-' . $node->gettype();
|
|
}
|
|
|
|
|
|
|
|
|