restreint carrousel ressourece

This commit is contained in:
2025-05-26 14:49:53 +02:00
parent 08d8b37aa2
commit 0de3eb6351
2 changed files with 33 additions and 2 deletions
+14
View File
@@ -51,6 +51,8 @@ function eql_preprocess_node(&$variables){
}
}
}
function eql_preprocess_page(array &$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface && $node->bundle() === 'ressource') {
@@ -70,6 +72,18 @@ function eql_preprocess_page(array &$variables) {
}
}
function eql_preprocess_block(array &$variables) {
// Vérifie si on est sur une page node de type 'ressource'
$route_match = \Drupal::routeMatch();
$node = $route_match->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface && $node->bundle() === 'ressource') {
$variables['is_ressource_page'] = TRUE;
}
else {
$variables['is_ressource_page'] = FALSE;
}
}
function eql_preprocess_field(&$variables) {