Customized XSLT stylesheets for more than one language
Hi Our library has two Koha instances. For one of them we need to customize the XSLT stylesheets used for the detail page - for this instance we need to have our own detail page in English (en) and our own detail page in German (de-DE). According to https://koha-community.org/manual/18.05/en/html/02_administration.html#opacx... I tried to do the following under Koha 18.05 in my own demo installation: * I created the files "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/MARC21slim2OPACDetail-CUSTOM.xsl" and "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/de-DE/MARC21slim2OPACDetail-CUSTOM.xsl" using the original stylesheets but just making some slight changes for a start (for example writing "XXXEdition: " instead of "Edition: " which works without problems when changing the standard file) ...I also tried using other paths but to no avail... * In Koha system preference "OPACXSLTDetailsDisplay" I entered "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/{langcode}/MARC21slim2OPACDetail-CUSTOM.xsl" * I restarted Koha using "service koha-common restart" * I also restarted the Apache HTTP Server using "service apache2 restart" However, when searching the OPAC in the normal view the actual details won't show up at all anymore, just the tags, the stars and the holdings table of the respective record; MARC view and ISBD view show the data is there. There seems to be something wrong when using paths, even when not using {langcode}... And it also doesn't work when using an external URL like http://adminkuhn.ch/download/MARC21slim2OPACDetail.xsl Has anyone done this before, how can this actually be achieved? What am I missing? Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
Hi Michael, There _may_ be a syntax error in your customised stylesheet. What I tend to do whenever I make changes to our .xsl files is to test the validity of the output by running the following in a terminal: xsltproc <STYLESHEET_FILENAME> <SAMPLE_MARCXML_DATA> ... and then I inspect the output. You can create a file with sample MARCXML data with an SQL query like this: SELECT metadata FROM biblio_metadata WHERE biblionumber = 1786 INTO OUTFILE '/tmp/biblio1786.marcxml' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' ESCAPED BY '' LINES TERMINATED BY '' ; I hope this helps. Kind regards, Andreas On Thu, 15 Nov 2018 at 23:56, Michael Kuhn <mik@adminkuhn.ch> wrote:
Hi
Our library has two Koha instances. For one of them we need to customize the XSLT stylesheets used for the detail page - for this instance we need to have our own detail page in English (en) and our own detail page in German (de-DE).
According to
https://koha-community.org/manual/18.05/en/html/02_administration.html#opacx... I tried to do the following under Koha 18.05 in my own demo installation:
* I created the files "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/MARC21slim2OPACDetail-CUSTOM.xsl"
and "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/de-DE/MARC21slim2OPACDetail-CUSTOM.xsl"
using the original stylesheets but just making some slight changes for a start (for example writing "XXXEdition: " instead of "Edition: " which works without problems when changing the standard file) ...I also tried using other paths but to no avail...
* In Koha system preference "OPACXSLTDetailsDisplay" I entered
"/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/{langcode}/MARC21slim2OPACDetail-CUSTOM.xsl"
* I restarted Koha using "service koha-common restart"
* I also restarted the Apache HTTP Server using "service apache2 restart"
However, when searching the OPAC in the normal view the actual details won't show up at all anymore, just the tags, the stars and the holdings table of the respective record; MARC view and ISBD view show the data is there. There seems to be something wrong when using paths, even when not using {langcode}... And it also doesn't work when using an external URL like http://adminkuhn.ch/download/MARC21slim2OPACDetail.xsl
Has anyone done this before, how can this actually be achieved? What am I missing?
Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
I've modified my xsl files extensively for the MedStar Authors Catalog. Two thoughts: First, xslt files are very easy to break. One little > out of place can make the entire display higgledy piggledy. Go back and check every modification looking for stray characters. Second, both the Detail.xsl and Results.xsl files have to know where the Utils.xsl file is. Check to see if the path is correct. If you modify the xsl files, I'd recommend putting them somewhere else--that way when you update Koha, they won't get overwritten. So far I haven't run into an update that broke my old stylesheets. For mysterious reasons having to do with my organization's firewall, I put all of my xsl files on a different server, so my authcatDetail.xsl and authcatResults.xsl files have the line <xsl:import href="http://dokument.space/scratchmonkey/authcatUtils.xsl"/> in them. A bit clumsy, but it works. Good luck! Fred King Medical Librarian, MedStar Washington Hospital Center fred.king@medstar.net 202-877-6670 ORCID 0000-0001-5266-0279 MedStar Authors Catalog: http://medstarauthors.org Somehow it seems I managed to get old. I really have no idea how that happened. --Brian Baker -----Original Message----- From: Koha [mailto:koha-bounces@lists.katipo.co.nz] On Behalf Of Michael Kuhn Sent: Thursday, November 15, 2018 4:55 PM To: Koha : access Subject: [Koha] Customized XSLT stylesheets for more than one language ** ATTENTION: This email originated from outside the MedStar network. ** DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe. Hi Our library has two Koha instances. For one of them we need to customize the XSLT stylesheets used for the detail page - for this instance we need to have our own detail page in English (en) and our own detail page in German (de-DE). According to https://urldefense.proofpoint.com/v2/url?u=https-3A__koha-2Dcommunity.org_manual_18.05_en_html_02-5Fadministration.html-23opacxsltdetailsdisplay&d=DwIGaQ&c=RvBXVp2Kc-itN3g6r3sN0QK_zL4whPpndVxj8-bJ04M&r=vKh6XwOmjyC51IkP1OfsdjQZoWT2vpi6VZl8El8EPRI&m=k3ccE0qx0BrZ1JahhteabqKE3iaaR_CTKT0_IWkgpNU&s=tRQ6NTiKywKuurQ8cZg4LBNHrArda5MM2f1LB2c9-rM&e= I tried to do the following under Koha 18.05 in my own demo installation: * I created the files "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/MARC21slim2OPACDetail-CUSTOM.xsl" and "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/de-DE/MARC21slim2OPACDetail-CUSTOM.xsl" using the original stylesheets but just making some slight changes for a start (for example writing "XXXEdition: " instead of "Edition: " which works without problems when changing the standard file) ...I also tried using other paths but to no avail... * In Koha system preference "OPACXSLTDetailsDisplay" I entered "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/{langcode}/MARC21slim2OPACDetail-CUSTOM.xsl" * I restarted Koha using "service koha-common restart" * I also restarted the Apache HTTP Server using "service apache2 restart" However, when searching the OPAC in the normal view the actual details won't show up at all anymore, just the tags, the stars and the holdings table of the respective record; MARC view and ISBD view show the data is there. There seems to be something wrong when using paths, even when not using {langcode}... And it also doesn't work when using an external URL like https://urldefense.proofpoint.com/v2/url?u=http-3A__adminkuhn.ch_download_MARC21slim2OPACDetail.xsl&d=DwIGaQ&c=RvBXVp2Kc-itN3g6r3sN0QK_zL4whPpndVxj8-bJ04M&r=vKh6XwOmjyC51IkP1OfsdjQZoWT2vpi6VZl8El8EPRI&m=k3ccE0qx0BrZ1JahhteabqKE3iaaR_CTKT0_IWkgpNU&s=cJ2L8jrQ7DnC-CxCUX6NZA03sU-TNIUtDQKwS2M1jqw&e= Has anyone done this before, how can this actually be achieved? What am I missing? Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W https://urldefense.proofpoint.com/v2/url?u=http-3A__www.adminkuhn.ch&d=DwIGaQ&c=RvBXVp2Kc-itN3g6r3sN0QK_zL4whPpndVxj8-bJ04M&r=vKh6XwOmjyC51IkP1OfsdjQZoWT2vpi6VZl8El8EPRI&m=k3ccE0qx0BrZ1JahhteabqKE3iaaR_CTKT0_IWkgpNU&s=UAIp6-mgGg6JWh2ncoJjh8ua-Z0zg4dN0lVvHGiVfqE&e= _______________________________________________ Koha mailing list https://urldefense.proofpoint.com/v2/url?u=http-3A__koha-2Dcommunity.org&d=DwIGaQ&c=RvBXVp2Kc-itN3g6r3sN0QK_zL4whPpndVxj8-bJ04M&r=vKh6XwOmjyC51IkP1OfsdjQZoWT2vpi6VZl8El8EPRI&m=k3ccE0qx0BrZ1JahhteabqKE3iaaR_CTKT0_IWkgpNU&s=gtuRdTjHMAJ5V0-hRLFTHW91HyaoT092RmWYgjujqeE&e= Koha@lists.katipo.co.nz https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.katipo.co.nz_mailman_listinfo_koha&d=DwIGaQ&c=RvBXVp2Kc-itN3g6r3sN0QK_zL4whPpndVxj8-bJ04M&r=vKh6XwOmjyC51IkP1OfsdjQZoWT2vpi6VZl8El8EPRI&m=k3ccE0qx0BrZ1JahhteabqKE3iaaR_CTKT0_IWkgpNU&s=sDpBIO5QDCsdHyD6pwLquYQ5VdSk_ESSzcjQlye6pD0&e=
Hi Andreas and Fred Thanks for your answers and suggestions! I'm baffled... after the daily resetting of my demo installation the thing that didn't work yesterday does work today... So for example in system preference "OPACXSLTDetailsDisplay" the path "/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/{langcode}/xslt/MARC21slim2OPACDetail-CUSTOM.xsl" will use the respective file in directory "en" or "de-DE" when changing the language. So I can positively say using {langcode} works as described... although it seems definitely necessary to restart koha-common / apache2 after making some change in the XSLT files. Otherwise you will probably experience confusing behavior of the view in the webbrowser (probably depending on browser caching and/or Plack). Best wishes & happy weekend: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
participants (3)
-
Andreas Roussos -
King, Fred -
Michael Kuhn