Bug 18148 - Make list of lists in OPAC sortable
Summary: Make list of lists in OPAC sortable
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P2 enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 28965
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-21 17:15 UTC by Alexandre
Modified: 2023-11-22 09:29 UTC (History)
9 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre 2017-02-21 17:15:50 UTC
Hi,

Some librarians ask us to have public lists in chronological order rather than in alphabetical order because some schools will have to kept them there for a long time. This results in a big list with many pages on which is more difficult to find the good list.

1) Go in an OPAC interface
2) Go to "Lists" normally in top left corner
3) A small list appears from the top of the screen, observe that this list is by modification date (not alphabetical order)
4) Clic then on public lists
5) Observe that all lists created are in alphabetical order and their order cannot be changed

We are wondering if it's possible to have some sorting options for the results list like in the staff client interface. There, you can change for chronological (modification or creation date) but also by owner order.

Thanks for helping us,

Alexandre from CCSR
Comment 1 Katrin Fischer 2020-04-19 11:02:01 UTC
I just checked, the table is not sortable, but it would be nice to have.
Comment 2 Owen Leonard 2020-04-20 12:39:47 UTC
The list of lists in the OPAC is paginated server-side, so adding sorting would require one of these methods:

1. Add sorting to the query, including handling of ascending and descending and the ability to order by the number of titles on the list.

2. Remove the server-side pagination and use DataTables to sort and paginate the all the results client-side. This would be adequate only if it isn't expected that there might be a very large number of lists.

3. Remove the server-side pagination and re-implement the table with an AJAX datasource, doing AJAX pagination.
Comment 3 Katrin Fischer 2020-04-28 19:45:28 UTC
I think 1) might be easiest, but I think we will keep adding new sort requests for every columsn etc and it seems a bit non-standard these days.

I am not sure how many entries some lists have - I haven't seen a really really long one, but it could happen... so maybe 3) would be best?

Adding tcohen as I think handling big table data server side is something he has been working on for acquisitions in order to fix performance issues.
Comment 4 Tomás Cohen Arazi 2020-04-28 20:00:33 UTC
(In reply to Owen Leonard from comment #2)
> The list of lists in the OPAC is paginated server-side, so adding sorting
> would require one of these methods:
> 
> 1. Add sorting to the query, including handling of ascending and descending
> and the ability to order by the number of titles on the list.
> 
> 2. Remove the server-side pagination and use DataTables to sort and paginate
> the all the results client-side. This would be adequate only if it isn't
> expected that there might be a very large number of lists.
> 
> 3. Remove the server-side pagination and re-implement the table with an AJAX
> datasource, doing AJAX pagination.

4. Add an API route for this, and use the features we've recently added (specially bug 24561). It would make sorting by any column just trivial.
Comment 5 Jason Robb 2020-11-16 21:53:16 UTC
We currently have a metric ton of public lists.

Having a way to sort and filter the list of lists in the OPAC like we can in the staff client would be incredibly beneficial to our OPAC users.
Comment 6 Sally 2021-09-06 16:31:30 UTC
We don't have a metric tonne, because we review and remove ours periodically, but it would be brilliant to have lists be sortable on the OPAC.

It'd be even better if the staff client could control the default order (e.g. date added, date desc).  

We don't have a preference over 1, 2, 3 or 4 - they're all workable solutions.  

2 might be nice for consistency; I think the Charges table uses DataTables on the OPAC?  We can always target a DataTable with jQuery to set the default sort.
Comment 7 Tomás Cohen Arazi 2021-09-07 16:14:11 UTC
(In reply to Sally from comment #6)
> 2 might be nice for consistency; I think the Charges table uses DataTables
> on the OPAC?  We can always target a DataTable with jQuery to set the
> default sort.

Truth is, 4 implies 2. i.e. implement using DataTables, but against the API instead of a custom script in svc.

Let's do it :-D
Comment 8 Sally 2021-10-06 08:33:47 UTC
Ah brilliant - sounds like a great approach!
Comment 9 Marjorie Barry-Vila 2021-11-23 16:20:10 UTC
+1
Comment 10 Barbara Johnson 2022-02-17 17:05:53 UTC
Our library would like to be able to sort the list of lists alphabetically and by date.  It would also be nice if there was a way to bump a specific list (such as a seasonal list or hot top) to the top of the list of lists in order to highlight it for patrons.
Comment 11 Sally 2022-07-27 12:21:56 UTC
We're still interested in this development.
Comment 12 Donna 2022-08-15 17:36:50 UTC
We've recently had more libraries asking for options in how the lists display in the OPAC.  Ideally, the option to order them like news items are handled using "display in position" would be best.
Comment 13 Katrin Fischer 2022-08-15 17:47:01 UTC
(In reply to Donna from comment #12)
> We've recently had more libraries asking for options in how the lists
> display in the OPAC.  Ideally, the option to order them like news items are
> handled using "display in position" would be best.

I think it makes it a little hard to order/reorder if you have a lot of lists. Maybe we could integrate something like drag&drop sorting to make this easier to handle.
Comment 14 David Cook 2023-03-24 05:25:14 UTC
Had a library ask for this today, but it sounds like the community is a bit stuck on how to proceed?

For what it's worth, on the server side, we're using DataTables. We may as well do it on the OPAC too.
Comment 15 Fiona Fogden 2023-06-09 08:56:41 UTC
PLEASE can the list of lists at the very least be sortable alphabetically? Sorted by creation or some other random order really makes it a challenge to promote the lists and the only workaround is to create links to the lists manually in alpha order in an html page so defeating the otherwise brilliant idea of the lists. 
This is coming from a Koha user & Librarian in a membership organisation. 

Thank you, Fiona, RICS.
Comment 16 David Cook 2023-11-22 05:51:03 UTC
(In reply to Fiona Fogden from comment #15)
> PLEASE can the list of lists at the very least be sortable alphabetically?
> Sorted by creation or some other random order really makes it a challenge to
> promote the lists and the only workaround is to create links to the lists
> manually in alpha order in an html page so defeating the otherwise brilliant
> idea of the lists. 
> This is coming from a Koha user & Librarian in a membership organisation. 
> 
> Thank you, Fiona, RICS.

It looks like the list of lists is sorted alphabetically in the OPAC:

http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=list&public=0
http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=list&public=1

Although in the "Lists" dropdown it seems to be sorted by newest to oldest. 

Funnily enough the list of lists in the staff interface seems to sort by oldest to newest:

http://localhost:8081/cgi-bin/koha/virtualshelves/shelves.pl
Comment 17 David Cook 2023-11-22 06:03:27 UTC
I do want to look at this before the end of the year.

Reminder to myself and others that the DataTable wrapper around the REST API comes from bug 24561

I'm not sure this feature is currently used in OPAC at all, but bug 24561 appears to have added it for OPAC so fingers crossed that it works.
Comment 18 David Cook 2023-11-22 06:06:31 UTC
Not quite ready to take this one as Assignee yet. At the moment, I'm trying to still figure out how much work this is going to be...
Comment 19 Fiona Fogden 2023-11-22 09:29:16 UTC
Thank you @david cook. I am not technical but happy to help with testing if I can remember how to do that from my recent PTFS customer forum session!