From 05ff822fcb9be31a260ef9eac49ec3e90656078f Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 12 Nov 2024 11:01:57 +0000 Subject: [PATCH] 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 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 --- .../bootstrap/en/modules/opac-shelves.tt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 143491b555c..0d3137ee663 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -3,6 +3,7 @@ [% USE Koha %] [% USE KohaDates %] [% USE AdditionalContents %] +[% USE KohaPlugins %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET LoginEnabled = ( Koha.Preference('opacuserlogin') == 1 ) %] @@ -16,6 +17,7 @@ [% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %] [% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %] [% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %] +[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %] [% BLOCK delete_shelf %]
@@ -384,12 +386,12 @@ [% END %]