Our librarians requested the ability to search a specific library from the opac without requiring a patron to login or setup filters. We have a number of young patrons and the current process is rather cumbersome. I have some code that creates a Library menu in the opac header. It allows for an anonymous patron to select a library from the menu and have their search results automatically filtered. I have been working with Kyle Hall and the rest of the ByWater team to cleanup some of our modifications for potential inclusion upstream. A patch is coming...
Created attachment 47704 [details] [review] Add branch selector to the opac header Display a dropdown to select a branch on the opac. Used to limit the searches to a branch with out requiring a login or advanced filters. QA Followup from kyle@bywatersolutions.com * Change "Buildings" to "Libraries", add span with class for easy changing * Fix use of tabs * Update license version * Add "Clear selection" option * Remove use of TT markup inside HTML tags
Test Plan: - Enable SearchMyLibraryFirst syspref - Visit the opac. You should see a "Libraries" menu in the header - Select a library from the menu. - Your search results should be limited to the library - Select "Clear Selection" from the menu to restore the default behavior.
Created attachment 47714 [details] Screenshot of interface idea Is this "needs signoff?" My apologies if these comments are premature: Functionally this looks like it's working well. I think the interface needs some more thought though. Some comments: - I think the use of the "home" icon is potentially confusing, especially at narrow browser widths (and therefore mobile screens). I think many users would assume that a home icon means a home link. - There is nothing to indicate to the user what the menu does. That's a very big problem. My initial impression is that this is more like a setting, and should be treated more like a setting. It's also contextual information, like the display of the logged-in user's name. So it needs to orient the user and convey that it is a setting which can be modified. It might work better if we move it over to the right. See attached screenshot. Changing the text could give the user some idea about what it's for. The default state might be "Searching all libraries." For that matter, the "Clear selection" button might also say "Search all libraries." I'm not sure how to incorporate that into the display when the user is logged in. Maybe put it in a drop-down menu triggered by the logged-in user's name? A split button where the default action is a link to opac-user.pl? I'm not sure what the right solution is, but I think this needs more thought.
Why don't use 'OpacAddMastheadLibraryPulldown' sys pref ?
(In reply to Zeno Tajoli from comment #4) > Why don't use 'OpacAddMastheadLibraryPulldown' sys pref ? It has been a number of years since our librarians requested this feature but I think their concern with OpacAddMastheadLibaryPulldown was that it doesn't remember your search selection. If you click the Koha icon that takes you back to the home screen it defaults you to all libraries. The other advantage of this patch is the libraries can create shortcuts to the opac that sets the filter. For example they bookmark https://library.pennmanor.net/cgi-bin/koha/opac-setbranch.pl?newbranch=HAM At the time you couldn't do DNS subdomains to specific libraries.
Comment on attachment 47704 [details] [review] Add branch selector to the opac header Review of attachment 47704 [details] [review]: ----------------------------------------------------------------- ::: opac/opac-setbranch.pl @@ +26,5 @@ > +my $sessionID = $1; > +my $session = get_session($sessionID); > + > +if ( $input->param('newbranch') ) { > + $session->param( 'mylibraryfirst', $input->param('newbranch') ); No validation on the parameter?! @@ +27,5 @@ > +my $session = get_session($sessionID); > + > +if ( $input->param('newbranch') ) { > + $session->param( 'mylibraryfirst', $input->param('newbranch') ); > + $session->param( 'branch', $input->param('newbranch') ); I'm not sure it is wise to just shove a random parameter value like this into the session.
FQA for Mark's comments.
Is this still valid? See syspref preference OpacAddMastheadLibraryPulldown
Comment 5 talks about reasons why OpacAddMastheadLibraryPulldown doesn't match the original intention of this patch, but given the 5 years since this had any comments I don't know if this should remain open.
I have worked around this not getting much traction by setting up multiple subdomains with OPAC_SEARCH_LIMIT set in apache2. That approach has been working fine for our needs. This can be closed from my perspective.
Thx Chad for commenting! I am closing. Please feel free to reopen or file a new bug if there are still functionalities you are missing.