[Koha-bugs] [Bug 35305] Add XSLT for authority details page in staff interface

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 9 22:29:49 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35305

--- Comment #1 from Fridolin Somers <fridolin.somers at biblibre.com> ---
Created attachment 158772
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158772&action=edit
Bug 35305: Add XSLT for authority details page in staff interface

This adds a new system preference 'AuthorityXSLTDetailsDisplay'.
If set, authority MARCXML will be transformed using the XSLT
at the given filename or URL.
The HTML output will be displayed in place of tabs in details page.

The syspref value can contain {langcode} and {authtypecode} which will
be replaced by the appropriate value (resp. current language and
authority type code).

Test plan:
1) Apply patch and run updatedatabase
2) Search for an authority type GEOGR_NAME and view details page
3) Verify that display is not affected yet
4) Create an XSLT file (for example in /home/koha/xslt/en/GEOGR_NAME.xsl)
5) Set 'AuthorityXSLTDetailsDisplay' syspref value to :
   /home/koha/xslt/{langcode}/{authtypecode}.xsl
6) Refresh details page
7) Verify that display matches what you expect from your XSLT
8) Go to an authority of another type
9) Verify that the default display is used

Example of a minimal XSLT:

<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:marc="http://www.loc.gov/MARC21/slim"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes"/>
  <xsl:template match="marc:record">
    <xsl:element name="div">
      <xsl:attribute name="class">
        <xsl:text>authority-summary</xsl:text>
      </xsl:attribute>
      <xsl:value-of
select="marc:datafield[@tag='151']/marc:subfield[@code='a']"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list