Skip to content

Instantly share code, notes, and snippets.

Last active Apr 19, 2021
What would you like to do?
hide 856$u PDFs in Koha if users aren't logged in
// run 1) on opac-detail pages & 2) if no user is signed in
if (!!location.pathname.match('/cgi-bin/koha/') && !$('.loggedinusername').length) {
// replace 856$u links with a link to login instead
// this would need to be tweaked if there are multiple URLs per record
$('.results_summary.online_resources a')
.replaceWith('<a href="/cgi-bin/koha/">login to view PDF</a>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment