reha.theme 748 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Functions to support theming in the reha theme.
  5. */
  6. /**
  7. * Implements hook_preprocess_HOOK() for html.html.twig.
  8. */
  9. function reha_preprocess_html(&$variables) {
  10. $node = \Drupal::routeMatch()->getParameter('node');
  11. if ($node){
  12. $variables['attributes']['class'][] = 'node-type-' . $node->bundle();
  13. $variables['attributes']['class'][] = 'node-id-' . $node->id();
  14. }
  15. }
  16. /**
  17. * Implements hook_preprocess_HOOK() for page.html.twig.
  18. */
  19. function reha_preprocess_page(&$variables) {
  20. }
  21. /**
  22. * Implements hook_preprocess_HOOK() for node.html.twig.
  23. */
  24. function reha_preprocess_node(&$variables) {
  25. $node = &$variables['node'];
  26. $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
  27. }