[Koha] Ebook display in the opac

Katharina Klausner katharina.klausner at aei.mpg.de
Thu Feb 21 03:42:04 NZDT 2019


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 at 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 at lists.katipo.co.nz
>> https://lists.katipo.co.nz/mailman/listinfo/koha
>>
> _______________________________________________
> Koha mailing listhttp://koha-community.org
> Koha at 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 at aei.mpg.de



More information about the Koha mailing list