Like Bug 11083 for result display, allow XSLT for details display in staff interface
Created attachment 158772 [details] [review] 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>
Created attachment 158775 [details] [review] Bug 35305: Add sample XSLT for UNIMARC authorities Also creates UNIMARCauthUtils.xsl to share templates with UNIMARCauthResults.xsl
Created attachment 158781 [details] [review] Bug 35305: (follow-up) Fix identing
The display match with the XSLT for type GEOGR_NAME but for the other types the default display isn't use, it's the XSLT display who is using.
(In reply to Matthias Le Gac from comment #4) > The display match with the XSLT for type GEOGR_NAME but for the other types > the default display isn't use, it's the XSLT display who is using. Hi, could you explain more please ? Using a XSLT file only for GEOGR_NAME is just an example, you may create a file per authority type or for UNIMARC use the sample file.
(In reply to Fridolin Somers from comment #5) > (In reply to Matthias Le Gac from comment #4) > > The display match with the XSLT for type GEOGR_NAME but for the other types > > the default display isn't use, it's the XSLT display who is using. > > Hi, could you explain more please ? > > Using a XSLT file only for GEOGR_NAME is just an example, you may create a > file per authority type or for UNIMARC use the sample file. What I meant was that when I go to the details of a GEOGR_NAME authority it looks just like what I specified in the XSL but it also has an impact on the details page of a PERSO_NAME authority and if I've understood the test plan correctly it shouldn't.