Hardcoding XSLT files to force opening URLs in new window (bug #3098)
If XSLT is turned on (for OPAC details and results), the syspref OPACURLOpenInNewWindow is not obeyed. For sites who want URLs to open in a new window, this is a problem ranging from mildly annoying to a serious concern. I reported it as a bug (#3098) some time ago, and revisited it again today for one of my sites. I have not yet been able to figure out how to pass the syspref into the XSLT files, but I have been able to hardcode those files to force opening a new window instead of the default same window. Following discussion on the IRC today, I'm not going to send this as a patch, but I thought I'd share it for other sites who want URLs to open in a new window and want an interim local fix until the larger problem of passing/obeying sysprefs is solved. Under koha-tmpl/opac-tmpl/prog/en/xslt, in MARC21slim2OPACDetail.xsl and MARC21slim2OPACResults.xsl, under the 856 section, search for the line <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> Change the beginning <a> as follows: <a target="_blank"> Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com
I have not yet been able to figure out how to pass the syspref into the XSLT files, but I have been able to hardcode those files to force opening a new window instead of the default same window.
I have a patch to do that. I will package it and send it to patches list. You will have syspref appended to <record> like that: <record> ... <sysprefs> <syspref name="OPACURLOpenInNewWindow">0</syspref> </sysprefs> </record> -- Frédéric
Many thanks! That removes one particular headache... Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com -----Original Message----- From: Frederic Demians [mailto:frederic@tamil.fr] Sent: Friday, July 24, 2009 12:50 PM To: Wagner, Jane Cc: koha-devel@lists.koha.org Subject: Re: [Koha-devel] Hardcoding XSLT files to force opening URLs in new window (bug #3098)
I have not yet been able to figure out how to pass the syspref into the XSLT files, but I have been able to hardcode those files to force opening a new window instead of the default same window.
I have a patch to do that. I will package it and send it to patches list. You will have syspref appended to <record> like that: <record> ... <sysprefs> <syspref name="OPACURLOpenInNewWindow">0</syspref> </sysprefs> </record> -- Frédéric
Of course, if/when the larger problem is fixed, having applied this patch may prevent the real fix from applying on your system, FYI. I can see how this would be annoying, but those libraries who think this is a "serious concern" probably haven't seen an actual serious problem in a while. To keep things in perspective: that would be data corruption, system instability, fatal error, or anything else that doesn't have a workaround on any modern browser with a right-click. -- Joe Atzberger LibLime - Open Source Library Solutions On Fri, Jul 24, 2009 at 12:22 PM, Wagner, Jane <jwagner@ptfs.com> wrote:
If XSLT is turned on (for OPAC details and results), the syspref OPACURLOpenInNewWindow is not obeyed. For sites who want URLs to open in a new window, this is a problem ranging from mildly annoying to a serious concern. I reported it as a bug (#3098) some time ago, and revisited it again today for one of my sites.
I have not yet been able to figure out how to pass the syspref into the XSLT files, but I have been able to hardcode those files to force opening a new window instead of the default same window. Following discussion on the IRC today, I'm not going to send this as a patch, but I thought I'd share it for other sites who want URLs to open in a new window and want an interim local fix until the larger problem of passing/obeying sysprefs is solved.
Under koha-tmpl/opac-tmpl/prog/en/xslt, in MARC21slim2OPACDetail.xsl and MARC21slim2OPACResults.xsl, under the 856 section, search for the line
<a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
Change the beginning <a> as follows:
<a target="_blank">
Jane Wagner Library Systems Analyst PTFS Inc. Content Management and Library Solutions 6400 Goldsboro Road, Suite 200 Bethesda, MD 20817 (301) 654-8088 x 151 jwagner@ptfs.com
participants (3)
-
Frederic Demians -
Joe Atzberger -
Wagner, Jane