some tools needs to add javascript just before the </body> tag .This is particularly the case of statistical : - Piwik (the page "http://developer.piwik.org/api-reference/tracking-javascript" indicates "copy and paste the JavaScript Tracking code into your pages, just before the </body> tag") - Google Analytics (the page "https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingOverview?hl=fr" indicates "This tracking code snippet should be included in your site's pages so that it appears at the bottom of the page's HTML (or generated-HTML) structure, before the closing <body> tag.") To use these tools with the syspref "opacuserjs", its use should be moved to the end of opac-bottom.inc
Created attachment 33521 [details] [review] proposed patch proposed patch
Comment on attachment 33521 [details] [review] proposed patch Review of attachment 33521 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ +238,5 @@ > [% PROCESS jsinclude %] > > +<script type="text/javascript"> > + //<![CDATA[ > + [% IF ( opacuserjs ) %][% opacuserjs %][% END %] Wouldn't it make more sense to put the IF and END around the entire script? Why generate a hollow script section?
(In reply to M. Tompsett from comment #2) > Wouldn't it make more sense to put the IF and END around the entire script? > Why generate a hollow script section? I agree. Other than that I think this change will work.
Created attachment 33548 [details] [review] new proposed patch new proposed patch taking into account the suggestions
Created attachment 33579 [details] [review] [SIGNED-OFF] Bug 13247 - Move opacuserjs at the end of opac-bottom.inc This patch makes opacuserjs compatible with tracking tools like Piwik Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 33600 [details] [review] [PASSED QA] Bug 13247 - Move opacuserjs at the end of opac-bottom.inc This patch makes opacuserjs compatible with tracking tools like Piwik Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Small change to enable use of opacuserjs for statistical tools like Piwik by moving it right above </body>. Works as described.
Patch pushed to master. Thanks Stephane!