Bugzilla – Attachment 184570 Details for
Bug 40482
bookcover/bookcoverimg class in search results show include more data-attributes for customization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40482: Add useful data-attributes to cover image containers on OPAC/staff search results
Bug-40482-Add-useful-data-attributes-to-cover-imag.patch (text/plain), 4.07 KB, created by
Owen Leonard
on 2025-07-23 18:48:16 UTC
(
hide
)
Description:
Bug 40482: Add useful data-attributes to cover image containers on OPAC/staff search results
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-07-23 18:48:16 UTC
Size:
4.07 KB
patch
obsolete
>From b922f48c350496ca569f7f0df9a765b057706941 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../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 %] > <tr id="row[% SEARCH_RESULT.biblionumber | html %]"> > [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >- <td class="bookcoverimg"> >+ <td >+ class="bookcoverimg" >+ data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" >+ data-itemtype="[% SEARCH_RESULT.itemtype | html %]" >+ data-itemtype_description="[% ItemTypes.GetDescription(SEARCH_RESULT.itemtype) | html %]" >+ data-title="[% SEARCH_RESULT.itemtype | html %]" >+ data-subtitle="[% SEARCH_RESULT.itemtype | html %]" >+ data-author="[% SEARCH_RESULT.itemtype | html %]" >+ data-isbn="[% SEARCH_RESULT.normalized_isbn | $raw %]" >+ > > <div > id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" > class="cover-slides" >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >index be2953a45f7..16f7fe26984 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >@@ -1,5 +1,15 @@ > [% USE raw %] >-<div class="bookcover"> >+[% USE ItemTypes %] >+<div >+ class="bookcover" >+ data-itemtype="[% SEARCH_RESULT.itemtype | html %]" >+ data-itemtype_description="[% ItemTypes.GetDescription(SEARCH_RESULT.itemtype) | html %]" >+ data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" >+ data-title="[% SEARCH_RESULT.title | html %]" >+ data-subtitle="[% SEARCH_RESULT.subtitle | html %]" >+ data-author="[% SEARCH_RESULT.author | html %]" >+ data-isbn="[% SEARCH_RESULT.normalized_isbn | html %]" >+> > <div > class="cover-slider cover-slides itemtype_[% SEARCH_RESULT.itemtype | html %]" > data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40482
:
184567
| 184570