config view

This commit is contained in:
2023-11-06 12:52:04 +01:00
parent ea38bdd02f
commit 8668a0438e
5 changed files with 138 additions and 25 deletions
+12 -12
View File
@@ -18,19 +18,19 @@ function rorschach_preprocess_html(&$variables) {
}
function rorschach_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;
}
if($node->gettype() == "offre_de_service") {
$type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
}
// function rorschach_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;
// }
// if($node->gettype() == "offre_de_service") {
// $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
// $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
// }
}
// }
function rorschach_preprocess_field(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');