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 %}