CARLI / vufind

A library resource discovery portal designed and developed for libraries by libraries
GNU General Public License v2.0
5 stars 0 forks source link

Allow user to adjust the number of results on the page from 20 #391

Closed gibsonjc closed 5 years ago

gibsonjc commented 6 years ago

KNX - It would be nice to have a toggle to change the number of results displayed on a page. I suppose the number "20" is fixed for all results pages, including reserves.

gibsonjc commented 5 years ago

This needs research. Is there a setting somewhere already defined that we can turn on? If not, could this be a bad idea for performance reasons and that's why they limited it to 20?

cedelis commented 5 years ago

In TEST

Yes, this is configurable:

https://github.com/CARLI/vufind/blob/carli-release-4.1/config/vufind/searches.ini#L27

; This section controls the result limit options for search results. default_limit ; sets the default number of results per page. limit_options is a comma-separated ; list of numbers to be presented to the end-user. If only one limit is required, ; set default_limit and leave limit_options commented out. ; WARNING: using large limits may require you to raise your PHP memory limits to ; avoid errors. default_limit = 20 ;limit_options = 10,20,40,60,80,100

In TEST, I've un-commented-out limit_option, so now there is a choice among 10,20,40,60,80, and 100 (default 20).

These same configuration options are available for Reserves searches, too, but it's not documented. However, after using the same settings for Reserves, I noticed that only the 'default_limit' value was honored. In order to offer the user the ability to select available limit options, I had to edit the template to render the control. I've done this, too, in TEST:

diff --git a/themes/carli/templates/search/reservessearch.phtml b/themes/carli/templates/search/reservessearch.phtml index b55aeab..efd97cc 100644 --- a/themes/carli/templates/search/reservessearch.phtml +++ b/themes/carli/templates/search/reservessearch.phtml @@ -43,6 +43,7 @@

 <? if ($recordTotal > 0): ?>
   <div class="pull-right flip">

+<?=$this->render('search/controls/limit.phtml')?> <?=$this->render('search/controls/sort.phtml')?>

<? endif; ?> @@ -53,6 +54,7 @@

transEsc('nohit_parse_error')?>

 <? endif; ?>

<? else: ?> +

gibsonjc commented 5 years ago

The number of results options seems to be working well in searches and in Reserves. Will wait for @dmcmpbll to weigh in on her testing before next step.

Anyone have opinions on the number of choices? There's nothing wrong with 10 20 40 60 80 100, but maybe 10 20 50 100 would be enough?

gibsonjc commented 5 years ago

At our 4/25 meeting we decided to make the choices: 10, 20, 40, 60

gibsonjc commented 5 years ago

@cedelis can you adjust these choices on TEST to: 10, 20, 40, 60 Thanks!

cedelis commented 5 years ago

@gibsonjc These have been adjusted. Thanks

gibsonjc commented 5 years ago

This is ready for Prod!

cedelis commented 5 years ago

In PROD

transEsc('Department')?>