From 46ed6fbc0485cef1a30171fb900cbbe5b07a9846 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 7 Aug 2025 15:51:44 +0000 Subject: [PATCH] Bug 40612: Eliminate duplicate element id in OPAC language menus This patch updates the include file used to display the OPAC language menu in the header and footer. The include already makes use of a "context" variable which tells it whether it's in the header or footer. We can use the same logic to give unique ids for each instance. To test, apply the patch and rebuild the OPAC CSS. - Go to Administration -> System preferences -> OpacLangSelectorMode and set it to "both top and footer." - Go to the OPAC and inspect the HTML for each language menu. The one in the header should have the id "header_langmenu." The one in the footer should have "footer_langmenu." Sponsored-by: Athens County Public Libraries Signed-off-by: Ludovic Julien Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 2 +- .../opac-tmpl/bootstrap/en/includes/langmenu.inc | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 52cfc9a2f9..ea8db4c9b8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -312,7 +312,7 @@ th { margin: .2rem .2rem .2rem 0; } -#header_langmenu { +.langmenu { flex-shrink: 1; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc index 06815665fb..e84e3c82fe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/langmenu.inc @@ -1,10 +1,12 @@ -
+[% IF ( context == "footer" ) -%] + [% SET li_class = 'nav-item dropup' %] + [% SET menu_id = 'footer_langmenu' %] +[% ELSE %] + [% SET li_class = 'nav-item dropdown' %] + [% SET menu_id = 'header_langmenu' %] +[% END %] +