getParameter('node'); if ($node){ $variables['attributes']['class'][] = 'node-type-' . $node->bundle(); $variables['attributes']['class'][] = 'node-id-' . $node->id(); } } function eql_preprocess_node(&$variables){ $node = &$variables['node']; $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); if($node->gettype() == "actualite") { $actu_type = $node->get('field_actu_type')->getString(); $variables['attributes']['class'][] = 'actu-type-' . $actu_type; } } ///////////////////////////////////////////////////