Last active
February 19, 2022 16:18
-
-
Save phette23/f4595ae6b8bddcf8d55cd12cc378253a to your computer and use it in GitHub Desktop.
hide 856$u PDFs in Koha if users aren't logged in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run 1) on opac-detail pages & 2) if no user is signed in | |
if (!!location.pathname.match('/cgi-bin/koha/opac-detail.pl') && !$('.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/opac-user.pl">login to view PDF</a>') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment