Interface test: Collection code groups

Does your library have too many choices on the OPAC’s advanced search page? From the point of view of our librarians we don’t, but I think from the point of view of the patrons we do. 43 choices? And many of those categories encompass the same materials or genres. You could easily group our categories using format, audience, or other criteria:

  • Videos: AV, AVJ, AVJN, AVNF
  • Books for adults: AF, MYS, SCI, WES, LP, LPNF, PB, BIO, NF
  • Large Print: LP, LPNF

It’d be great if you could define “category groups” in Koha to allow patrons to easily search multiple categories at once. Until that comes about, how can we approach the problem from the front end?

Selecting Multiple Categories with JavaScript

Here’s a little experiment I worked up. This is just a static example page to demonstrate the selections.  Some parts of the OPAC omitted for simplicity.


Try clicking the links at the top of the category table. Clicking “Books” will select all collection codes which I’ve defined as a book for adults. Clicking “Audio Books” will select any category which could be defined as an audio book, whether it be on CD, cassette, or Playaway.

All the functionality of this example could be layered on top of the OPAC using existing avenues for customization like the opacuserjs system preference. It’s not very efficient to set up, however, because you have to hard-code all your collection codes within the JavaScript. That means that you have to update your script any time you add a category.

[sourcecode language=”javascript”] var books = “#ccode-1,#ccode-5,#ccode-12,#ccode-13,#ccode-14,#ccode-15,#ccode-16,#ccode-17,#ccode-18,#ccode-19,#ccode-27”;
var movies = “#ccode-2,#ccode-3,#ccode-4,#ccode-6,#ccode-23,#ccode-39,#ccode-40,#ccode-41”;
var lp = “#ccode-13,#ccode-14”;

Defining your “supercategories” could be as difficult as defining your original categories in Koha. What criteria do you use? Audience? Format? Content? In my example I mix all three. Would that be confusing to patrons? I may yet add this to our OPAC, but I’ll have to ponder these issues a little more.

1 thought on “Interface test: Collection code groups

  1. Joann Ransom

    Hi Owen,

    I grappled with this very problem too. I think 43 categories is way too many options for a borrower to select from in the OPAC advanced search.

    In the end, I opted for clustering our various item types (of which we have many) into 12 CCodes and setting CCodes as the advnaced search option.

    I am still left with the problem of being able to only assign 1 CCode when I would like to be able to assign 2.

    For instance, I would to put Large print fiction into both the Large Print CCode and the Adult Fiction CCode. And a book on carving greenstone into both Maori Collection and Adult NonFiction.

    Great blog – keep writing!


Leave a Reply

Your email address will not be published.