Bug 40482

Summary: bookcover/bookcoverimg class in search results show include more data-attributes for customization
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: MARC Bibliographic data supportAssignee: Lucas Gass (lukeg) <lucas>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 40482: Add useful data-attributes to cover image containers on OPAC/staff search results
Bug 40482: Add useful data-attributes to cover image containers on OPAC/staff search results

Description Lucas Gass (lukeg) 2025-07-23 16:44:20 UTC
I would like to have more data-attributes on the bookcover class in search results.

There is already some data-attributes on cover-slider element but that gets removed when there is no cover. It would still be useful to have data-attr for things like biblionumber, title, itemtype so customizations ( with only CSS )can easily be made in the event of no cover image.
Comment 1 Lucas Gass (lukeg) 2025-07-23 16:58:27 UTC
Created attachment 184567 [details] [review]
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.
Comment 2 Owen Leonard 2025-07-23 18:48:16 UTC
Created attachment 184570 [details] [review]
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>