Bug 15749 - Add library menu to OPAC header
Summary: Add library menu to OPAC header
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chad Billman
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-05 15:45 UTC by Chad Billman
Modified: 2022-12-12 21:23 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Add branch selector to the opac header (5.42 KB, patch)
2016-02-05 15:53 UTC, Chad Billman
Details | Diff | Splinter Review
Screenshot of interface idea (15.87 KB, image/png)
2016-02-05 16:39 UTC, Owen Leonard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chad Billman 2016-02-05 15:45:44 UTC
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...
Comment 1 Chad Billman 2016-02-05 15:53:57 UTC
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
Comment 2 Chad Billman 2016-02-05 15:59:20 UTC
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.
Comment 3 Owen Leonard 2016-02-05 16:39:18 UTC
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.
Comment 4 Zeno Tajoli 2016-02-08 08:14:01 UTC
Why don't use 'OpacAddMastheadLibraryPulldown' sys pref ?
Comment 5 Chad Billman 2016-02-08 12:52:15 UTC
(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 6 Mark Tompsett 2016-03-28 03:07:35 UTC
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.
Comment 7 Liz Rea 2016-09-09 04:28:22 UTC
FQA for Mark's comments.
Comment 8 Fridolin Somers 2021-09-20 22:29:38 UTC
Is this still valid?
See syspref preference OpacAddMastheadLibraryPulldown
Comment 9 Owen Leonard 2021-09-21 10:26:14 UTC
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.
Comment 10 Chad Billman 2021-09-21 11:49:13 UTC
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.
Comment 11 Katrin Fischer 2021-12-17 22:52:16 UTC
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.