[Koha-patches] [PATCH] Bug 4276: Proposed fix for "Related Subjects" links in Opac.

Garry Collum gcollum at gmail.com
Sat Mar 20 02:25:35 CET 2010


Adds fields other than 'a' to the links for subject headings in the Opac details page.

Also adds subfield b of a Corporate Author (710) to the appropriate link.  Otherwise you may have a link with "United States" instead of "United States. Public Works Adminstration"

Another patch needs to be sent for the Intranet.
---
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
index 795856e..6f5f53b 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
@@ -130,7 +130,14 @@
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-            <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>      
+            <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=au&amp;q=<xsl:call-template name="chopPunctuation">
+	            <xsl:with-param name="chopString">
+		        <xsl:call-template name="subfieldSelect">
+			    <xsl:with-param name="codes">ab</xsl:with-param>
+			</xsl:call-template>
+                    </xsl:with-param>
+		</xsl:call-template>
+	    </xsl:attribute>      
             </xsl:otherwise>
         </xsl:choose>
         <xsl:call-template name="nameABCDN"/></a>
@@ -375,7 +382,14 @@
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idc=su&amp;q=<xsl:call-template name="chopPunctuation">
+		        <xsl:with-param name="chopString">
+			    <xsl:call-template name="subfieldSelect">
+			        <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
+			    </xsl:call-template>
+			</xsl:with-param>
+                    </xsl:call-template>
+                </xsl:attribute>
             </xsl:otherwise>
             </xsl:choose>
             <xsl:call-template name="chopPunctuation">
-- 
1.5.6.5




More information about the Koha-patches mailing list