From 4a1df1ec39d7ccfc87e8322f1a9b982315d220df Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 26 Aug 2020 13:49:53 +0000 Subject: [PATCH] Bug 26302: OPAC XSLT Results: List variable number of itemcallnumbers Content-Type: text/plain; charset=utf-8 We define a local preference resultsMaxItems and add it to the xml passed to the results XSLT (in C4::XSLT). Instead of showing one item, we add this number of items for the available for loan and reference segments. Test plan: Play with the value of local pref resultsMaxItems. Check if it matches with displayed callnumbers. Try home and holdingbranch for results location. Signed-off-by: Marcel de Rooy --- C4/XSLT.pm | 2 + .../en/xslt/MARC21slim2OPACResults.xsl | 41 +++++++++++++++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 3cdf451b28..77e56077f1 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -173,9 +173,11 @@ sub get_xslt_sysprefs { TrackClicks opacthemes IdRef OpacSuppression OPACResultsLibrary OPACShowOpenURL OpenURLResolverURL OpenURLImageLocation + resultsMaxItems OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) { my $sp = C4::Context->preference( $syspref ); + $sp ||= 1 if $syspref eq 'resultsMaxItems'; # needs default next unless defined($sp); $sysxml .= "$sp\n"; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 92d1d2ff8f..b496ca9f53 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -39,6 +39,7 @@ + @@ -1282,7 +1283,13 @@ Call number: - , .. + + + + , + + , .. + @@ -1302,10 +1309,16 @@ ) - + Call number: - , .. - + + + + , + + , .. + + . @@ -1322,10 +1335,16 @@ ) - + Call number: - , .. - + + + + , + + , .. + + . @@ -1362,7 +1381,13 @@ Call number: - , .. + + + + , + + , .. + . , -- 2.20.1