From 0de3eb6351a1cd3e2a484da4efcdbd424b73b47d Mon Sep 17 00:00:00 2001 From: ouidade Date: Mon, 26 May 2025 14:49:53 +0200 Subject: [PATCH] restreint carrousel ressourece --- web/themes/custom/eql/eql.theme | 14 +++++++++++++ ...entity-field--node--field-images.html.twig | 21 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/web/themes/custom/eql/eql.theme b/web/themes/custom/eql/eql.theme index e446bef..c81a414 100644 --- a/web/themes/custom/eql/eql.theme +++ b/web/themes/custom/eql/eql.theme @@ -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) { diff --git a/web/themes/custom/eql/templates/block--entity-field--node--field-images.html.twig b/web/themes/custom/eql/templates/block--entity-field--node--field-images.html.twig index cea01f7..f3d14e8 100644 --- a/web/themes/custom/eql/templates/block--entity-field--node--field-images.html.twig +++ b/web/themes/custom/eql/templates/block--entity-field--node--field-images.html.twig @@ -44,7 +44,24 @@ {% block content %} - #} {{ content }} {% endblock %}