Bug 38422

Summary: Add data-isbn and data-title to lists for plugin cover images
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: OPACAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: trivial    
Priority: P5 - low CC: david, martin.renvoize, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds cover images to OPAC lists, for OPAC enabled cover image sources. (Note: This currently only displays nicely with one source of cover images. With multiple sources enabled, the images are listed vertically.)
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 38422: Allow plugin cover images in OPAC lists
Bug 38422: Allow plugin cover images in OPAC lists

Description Matt Blenkinsop 2024-11-12 11:01:13 UTC
It isn't possible to display plugin cover images on the OPAC lists view - we need to enable the plugin method and pass the item data to the element
Comment 1 Matt Blenkinsop 2024-11-12 11:06:13 UTC
Created attachment 174401 [details] [review]
Bug 38422: Allow plugin cover images in OPAC lists

This patch updates the template to allow cover images from plugins in the OPAC list page. It adds a data-isbn and data-title attribute to the cover images element and also moves the element below the setting of the title so that we can pass that directly.

It also adds the script call to allow the plugin method to work on the page

Test plan:
1) View the patch diff and note that the data attributes have been added correctly
2) View the patch diff and note that the <a> tag has been moved below the setting of the img_title template variable
3) View the patch diff and note that the CoverImagePlugins variable has been set correctly (compare to the intranet file detail.tt for reference if needed)
4) Confirm that no changes have been made to any elements beyond adding the data attributes
Comment 2 Martin Renvoize (ashimema) 2024-12-12 16:28:49 UTC
Created attachment 175412 [details] [review]
Bug 38422: Allow plugin cover images in OPAC lists

This patch updates the template to allow cover images from plugins in the OPAC list page. It adds a data-isbn and data-title attribute to the cover images element and also moves the element below the setting of the title so that we can pass that directly.

It also adds the script call to allow the plugin method to work on the page

Test plan:
1) View the patch diff and note that the data attributes have been added correctly
2) View the patch diff and note that the <a> tag has been moved below the setting of the img_title template variable
3) View the patch diff and note that the CoverImagePlugins variable has been set correctly (compare to the intranet file detail.tt for reference if needed)
4) Confirm that no changes have been made to any elements beyond adding the data attributes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2024-12-12 16:29:36 UTC
Trivial, non-invasive, addition of plugin support hook in the OPAC.

Going straight for a PQA here.. we're using it in production already in 23.11.x and beyond.
Comment 4 Katrin Fischer 2024-12-23 09:37:30 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 5 David Nind 2025-01-01 22:44:07 UTC
Checking to see if this is an enhancement, rather than a bug.

Should I add a bug for displaying multiple images nicely, like we do in other areas of the OPAC and staff interface, instead of running vertically down the page?
Comment 6 Wainui Witika-Park 2025-04-10 05:08:45 UTC
This is in the commit log for 24.11, though not noted here yet.

Not backporting to 24.05.x unless requested