From 19c49c0ef8288350aa47f4eca1b5a2a8c18d8446 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 23 Jul 2025 16:54:17 +0000 Subject: [PATCH] Bug 40482: Add useful data-attributes to cover image containers on OPAC/staff search results This patch adds useful data-attributes to the bookcover/bookcoverimg container in the OPAC/staff search results. To test: 0. APPLY PATCH 1. Turn on at least 1 image service for both the OPAC and staff interface 2. Do a search that returns results 3. You should see the following data attributes, even when no cover image is supplied: data-biblionumber data-itemtype data-itemtype_description data-title data-subtitle data-author data-isbn You can now target these with just CSS. --- .../prog/en/modules/catalogue/results.tt | 12 +++++++++++- .../opac-tmpl/bootstrap/en/includes/cover-images.inc | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index ade947fd89d..b743a1de4b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -5,6 +5,7 @@ [% USE Biblio %] [% USE KohaDates %] [% USE KohaPlugins %] +[% USE ItemTypes %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] @@ -582,7 +583,16 @@ [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] - +
+[% USE ItemTypes %] +