Ebook display in the opac
Hi all, I'm trying to make our e-book display nicer in the catalog following these guidelines: https://bywatersolutions.com/education/koha-electronic-resources While the report works after some changes, the JS doesn't do anything. Can anybody tell me if the source code is correct? I'd be also happy about any other ideas on how to highlight ebook records in the opac. $(document).ready(function() { $.getJSON("https://YOUR.KOHA.SERVER.DOMAIN.NAME/cgi-bin/koha/svc/report?id=YOUR_REPORT_...", function(data) { for (var i = 0; i < data.length; i++) { var URL = data[i][0]; $("#userresults table td a[href^='" + URL + "']").each(function(index) { var link = $(this); var parent = link.parent(); var grandparent = parent.parent(); link.text('Available Online'); link.addClass('ebook'); parent.children('.label').hide(); grandparent.children('.availability').hide(); grandparent.children('.actions-menu').hide(); grandparent.children('#location').hide(); }); } }); }); Cheers Katharina -- Katharina Klausner Head of the Library / Leiterin der Bibliothek Max-Planck-Institut für Gravitationsphysik (Albert-Einstein-Institut) Am Mühlenberg 1 D-14476 Potsdam Tel.: +49 331 567-7400 E-Mail: katharina.klausner@aei.mpg.de <mailto:katharina.klausner@aei.mpg.de>
https://bywatersolutions.com/education/koha-electronic-resources
At the moment ByWater's blog isn't correctly formatting JS and CSS, so check this version: https://gitlab.com/snippets/1811230 I assume you're replacing DOMAIN.NAME and YOUR_REPORT_ID with the correct values? Another thing to check is whether your system has the TrackClicks preference enabled. If so, the script's check for URL patterns is going to need to be revised. -- Owen -- Web Developer Athens County Public Libraries https://www.myacpl.org
Hi I´m trying to make this changes and I get the folowing error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/datafield[@tag="856"]/subfield[@code="u"]),"/", 3) FROM biblio_metadata WHERE' at line 2 My sql report looks like: SELECT DISTINCT Substring_index(Extractvalue(metadata, ‘//datafield[@tag="856"]/subfield[@code="u"]),"/", 3) FROM biblio_metadata WHERE Extractvalue(metadata, ‘//datafield[@tag="856"]/subfield[@code="3"]’) LIKE ‘ACCESS ONLINE VERSION%’ Note that koha updated the marclxlm fields to metadata Any idea? I cant find where this error comes from. Since report does not work yet I didn't test the JS yet Regards Alvaro Cornejo |-----------------------------------------------------------------------------------------------------------------| Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular y Nextel en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y GPRS online Visitenos en www.perusms.com Le mer. 6 févr. 2019 à 09:02, Owen Leonard <oleonard@myacpl.org> a écrit :
https://bywatersolutions.com/education/koha-electronic-resources
At the moment ByWater's blog isn't correctly formatting JS and CSS, so check this version:
https://gitlab.com/snippets/1811230
I assume you're replacing DOMAIN.NAME and YOUR_REPORT_ID with the correct values? Another thing to check is whether your system has the TrackClicks preference enabled. If so, the script's check for URL patterns is going to need to be revised.
-- Owen
-- Web Developer Athens County Public Libraries https://www.myacpl.org _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
I´m trying to make this changes and I get the folowing error:
I think the problem again stems from copying and pasting code that has been poorly-formatted by a CMS. Try this: https://gitlab.com/snippets/1811390 -- Owen -- Web Developer Athens County Public Libraries https://www.myacpl.org
Thanks, yes it worked.!! |-----------------------------------------------------------------------------------------------------------------| Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular y Nextel en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y GPRS online Visitenos en www.perusms.com Le mer. 6 févr. 2019 à 13:19, Owen Leonard <oleonard@myacpl.org> a écrit :
I´m trying to make this changes and I get the folowing error:
I think the problem again stems from copying and pasting code that has been poorly-formatted by a CMS. Try this:
https://gitlab.com/snippets/1811390
-- Owen
-- Web Developer Athens County Public Libraries https://www.myacpl.org _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
Hi all, my colleague came up with a simpler solution without using reports. I edited all our e-book MARC records with MarcEdit to contain the phrase "Click here for online access" in 856 z. Then the opacuserjs is edited with this code: $(document).ready(function() { var tag = 'Click here for online access'; // iterate over all search result ebook URLs $(".searchresults .online_resources a:contains('" + tag + "')").each(function(index) { var link = $(this); var item = link.parent().parent(); // hide details not useful for online ebooks link.parent().children('.label').hide(); item.children('.availability').hide(); item.children('.actions-menu').hide(); // relocate ratings in front of the URLs item.children('.online_resources').prepend(item.children('.ratings').detach()); // redesign URLs as prominent buttons var extra = link.text().replace(tag, '').trim(); link.text(extra ? tag.concat(' (', extra, ')') : tag); link.prepend('<i class="fa fa-link"></i> '); link.addClass('btn btn-primary btn-xs'); }); }); Best regards Katharina Am 06.02.2019 um 19:38 schrieb Alvaro Cornejo:
Thanks, yes it worked.!!
|-----------------------------------------------------------------------------------------------------------------| Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular y Nextel en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y GPRS online Visitenos enwww.perusms.com
Le mer. 6 févr. 2019 à 13:19, Owen Leonard<oleonard@myacpl.org> a écrit :
I´m trying to make this changes and I get the folowing error: I think the problem again stems from copying and pasting code that has been poorly-formatted by a CMS. Try this:
https://gitlab.com/snippets/1811390
-- Owen
-- Web Developer Athens County Public Libraries https://www.myacpl.org _______________________________________________ Koha mailing listhttp://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________ Koha mailing listhttp://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Katharina Klausner Head of the Library / Leiterin der Bibliothek Max-Planck-Institut für Gravitationsphysik (Albert-Einstein-Institut) Am Mühlenberg 1 D-14476 Potsdam Tel.: +49 331 567-7400 E-Mail:katharina.klausner@aei.mpg.de
participants (3)
-
Alvaro Cornejo -
Katharina Klausner -
Owen Leonard