[Koha] How to hide Subfield in OPAC

Eric Phetteplace ephetteplace at cca.edu
Tue Apr 20 03:45:25 NZST 2021


Hi Ketut,

I'm sure someone will correct me if I'm wrong, but I don't think it's
possible to modify the display of records based on whether or not someone
is signed in. You can modify their display by editing Koha's XSLT
templates. See Koha > koha-tmpl > opac-tmpl > bootstrap > en > xslt, here's
an example one
<https://github.com/Koha-Community/Koha/blob/master/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl>.
But there is no way to change these conditionally based on whether a user
is authenticated or not.

You could simulate this with some jQuery:
https://gist.github.com/phette23/f4595ae6b8bddcf8d55cd12cc378253a

You would add this to your OPACUserJS setting. But it's not truly safe;
users could disable JavaScript and they would see the PDF URLs, or they
could view or export the underlying bibliographic record to find the URL.
The only truly safe way to do this is to put the PDFs behind authentication
somewhere e.g. in an institutional repository.

Best,

ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)

ephetteplace at cca.edu | o 510.594.3660 (cca)

5212 Broadway | Oakland, CA | 94618

CCA is situated on the traditional unceded lands of the Ohlone peoples.

Black-owned bookstores in Oakland: Ashay by the Bay
<https://ashaybythebay.com/>, Marcus Books
<https://www.facebook.com/marcus.books/>

:(){ :|: & };:


On Mon, Apr 19, 2021 at 2:16 AM Ketut Gunawan <kettgun at yahoo.com> wrote:

> Dear all,
> I am new to Koha so I need helps. I have a subfield 856$u containing PDF
> files in hundred of records. I want to hide it in OPAC so that public
> visitors cannot see "Online resources: Click here to access online", but
> for those who log in (students)  can see and click such a link.
>
> I have tried to read the manual and search the forum, but I can find it.
> Any help would be much appreciated.
>
> Best Regards,
> K. Gunawan
> SocPolSci Faculty, Mulawarman University
> Indonesia
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list