Bug 33819: Add page numbers to opac results breadcrumb

This patch adds the page number to the breadcrumb in the opac search results to ensure that it is unique to the content on the page. Currently it is not compliant to Accessibility guidelines as the breadcrumb is identical on every page despite the content being different.

To test:
1) Apply patch
2) Run a search in the OPAC that will return more than 20 results.
3) The breadcrumb should say "Results of search for 'search term', page x of y"
4) Run a search that will return less than 20 results
5) The breadcrumb should say "Results of search for 'search term'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-05-24 14:57:20 +00:00 committed by Tomas Cohen Arazi
parent dbd85697ac
commit 1a0ccaa991
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 7 additions and 3 deletions

View file

@ -47,9 +47,9 @@
[% END %]
<li class="breadcrumb-item active">
[% IF ( ms_value ) %]
<a href="#" aria-current="page" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Results of search for '[% ms_value | html %]'</a>
<a href="#" aria-current="page" title="You searched [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Results of search for '[% ms_value | html %]'[% IF ( pages > 1) %], page [% current_page_number | html %] of [% pages | html %][% END %]</a>
[% ELSE %]
<a href="#" aria-current="page" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Search results</a>
<a href="#" aria-current="page" title="You searched [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Search results</a>
[% END %]
</li>
[% ELSE %]

View file

@ -810,7 +810,11 @@ for (my $i=0;$i<@servers;$i++) {
sort_by => \@sort_by
}
);
$template->param( hits_to_paginate => $hits_to_paginate );
$template->param(
hits_to_paginate => $hits_to_paginate,
current_page_number => $current_page_number,
pages => $pages
);
$template->param( PAGE_NUMBERS => $page_numbers,
last_page_offset => $last_page_offset,
previous_page_offset => $previous_page_offset) unless $pages < 2;