eql.theme 518 B

1234567891011121314151617181920212223
  1. <?php
  2. /*
  3. * @files
  4. * Theme Template Funtions
  5. */
  6. // use Drupal\Core\Template\Attribute;
  7. // use Drupal\Core\Link;
  8. // use Drupal\Core\Url;
  9. function eql_preprocess_node(&$variables){
  10. $node = &$variables['node'];
  11. $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
  12. if($node->gettype() == "actualite") {
  13. $actu_type = $node->get('field_actu_type')->getString();
  14. $variables['attributes']['class'][] = 'actu-type-' . $actu_type;
  15. }
  16. }
  17. ///////////////////////////////////////////////////