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: Pushed to main --- QA Contact: Pedro Amorim <pedro.amorim>
Severity: enhancement    
Priority: P5 - low CC: pedro.amorim
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:
This enhancement adds data-attributes to the bookcover class in the OPAC and staff interface search results. This will make it easier to customization based on those attributes.
Version(s) released in:
25.11.00
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
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>
Comment 3 Pedro Amorim 2025-08-05 14:48:44 UTC
Created attachment 185125 [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>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 4 Lucas Gass (lukeg) 2025-08-14 22:09:31 UTC
Nice work everyone!

Pushed to main for 25.11