A bookmarklet to jump from OPAC to staff client

Koha has strong separation between OPAC and staff client functionalities. If you log in to the OPAC as a staff user you don’t have any kind of elevated privileges compared to any other user. This is good for extra security, but it can be frustrating for staff if they happen to be looking at a record in the OPAC and want to switch to the staff client.

I’m a big fan of bookmarklets as a tool for interacting with Koha. A bookmarklet is a browser bookmark which executes JavaScript on the page you’re looking at.

Below is a tool for generating a custom bookmarklet to use with your Koha OPAC. When you are looking at a bibliographic record in your OPAC, clicking the bookmarklet will open a new window and load the corresponding page in your staff client.

Select which page in the staff client you want your bookmarklet to take you to. Then enter the URL of your Koha staff client. The bookmarklet link is automatically updated with the settings you choose. Drag the link to the bookmarks toolbar.

Bookmarklet generator

Your bookmarklet: Detail view

Animation showing the how to drag the link to the bookmarks toolbar

Drag the link to your bookmarks toolbar.

Here is a formatted example of the code in your bookmarklet:

[sourcecode language=”javascript”] javascript: (function() {
var currenturl = window.location.search;
var regex = /\?biblionumber=([0-9]+)/;
var paramsArray = regex.exec( currenturl );
var biblionumber = paramsArray[1];
window.open(‘https://koha.example.com/cgi-bin/koha/catalogue/detail.pl?biblionumber=’ + biblionumber); })()

Leave a Reply

Your email address will not be published. Required fields are marked *