Browse Source

Bug 26825: Add span for publication date in OPAC

This patch modifies the XSL templates for OPAC results and OPAC details
so that the parts of the publisher details are wrapped separate <span>s:
Publisher place, name, and date.

To test, apply the patch "restart_all" if necessary.

You can add this to the OPACUserCSS system preference to better see the
change:

.publisher_place { color: red; }
.publisher_name { color: green; }
.publisher_date { color: orange; }

- Peform a search in the OPAC
- In the search results, confirm that the publisher plac, name, and date
  are wrapped in separate <span>s, either by confirming the custom
  colors or by inspecting the source.
- View the details for one of the results. Confirm that the same change
  has been made to the detail page.

Signed-off-by: B Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Owen Leonard 11 months ago
committed by Jonathan Druart
parent
commit
d80763c371
  1. 40
      koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl
  2. 30
      koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

40
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl

@ -313,32 +313,34 @@
<xsl:for-each select="marc:datafield[@tag=260]">
<span property="publisher" typeof="Organization">
<xsl:if test="marc:subfield[@code='a']">
<span property="location">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
</span>
<span class="publisher_place" property="location">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
</span>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="marc:subfield[@code='b']">
<span property="name"><a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/></xsl:attribute>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
</a></span>
<span property="name" class="publisher_name">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/></xsl:attribute>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
</a>
</span>
</xsl:if>
</span>
<xsl:text> </xsl:text>
<xsl:if test="marc:subfield[@code='c' or @code='g']">
<span property="datePublished">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">cg</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</span>
<span property="datePublished" class="publisher_date">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">cg</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</span>
</xsl:if>
<xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>

30
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

@ -1054,24 +1054,30 @@
<span class="results_summary publisher"><span class="label">Publication details: </span>
<xsl:for-each select="marc:datafield[@tag=260]">
<xsl:if test="marc:subfield[@code='a']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
<span class="publisher_place" property="location">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
</span>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="marc:subfield[@code='b']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
<span property="name" class="publisher_name">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
</span>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">cg</xsl:with-param>
<span property="datePublished" class="publisher_date">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">cg</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</span>
<xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
<xsl:if test="marc:datafield[@tag=264]">

Loading…
Cancel
Save