From 3a68d5a2c83668a717eaf1647f95d05884889b46 Mon Sep 17 00:00:00 2001 From: bach Date: Sat, 1 Mar 2025 23:11:49 +0100 Subject: [PATCH] home map label --- web/modules/custom/q2d_mod/q2d_mod.module | 2 +- web/modules/custom/q2d_mod/src/Plugin/Block/SitesMap.php | 2 ++ web/modules/custom/q2d_mod/templates/svg-mapsites.html.twig | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/modules/custom/q2d_mod/q2d_mod.module b/web/modules/custom/q2d_mod/q2d_mod.module index b1a6529..c535d39 100644 --- a/web/modules/custom/q2d_mod/q2d_mod.module +++ b/web/modules/custom/q2d_mod/q2d_mod.module @@ -11,7 +11,7 @@ function q2d_mod_theme() { return array( 'svg_mapsites' => array( - 'variables' => array('vpw' => null, 'vph' => null, 'sites' => []), + 'variables' => array('vpw' => null, 'vph' => null, 'sites' => [], 'label' => null), ), ); } \ No newline at end of file diff --git a/web/modules/custom/q2d_mod/src/Plugin/Block/SitesMap.php b/web/modules/custom/q2d_mod/src/Plugin/Block/SitesMap.php index b54f57b..e8a8eea 100644 --- a/web/modules/custom/q2d_mod/src/Plugin/Block/SitesMap.php +++ b/web/modules/custom/q2d_mod/src/Plugin/Block/SitesMap.php @@ -101,6 +101,7 @@ class SitesMap extends BlockBase { ], 'svg_mapsites' => [ '#theme' => 'svg_mapsites', + '#label' => "Les 10 sites de projet", '#sites' => $sites_paths, '#vpw' => $vp_w, '#vph' => $vp_h, @@ -117,6 +118,7 @@ class SitesMap extends BlockBase { // '#markup' => $this->t('Hello, Sites Map!'), // ]; } + public function getCacheMaxAge() { return 0; } diff --git a/web/modules/custom/q2d_mod/templates/svg-mapsites.html.twig b/web/modules/custom/q2d_mod/templates/svg-mapsites.html.twig index 97073c2..66528e9 100644 --- a/web/modules/custom/q2d_mod/templates/svg-mapsites.html.twig +++ b/web/modules/custom/q2d_mod/templates/svg-mapsites.html.twig @@ -1,4 +1,7 @@
+ +

{{label}}

+ {# #}