Bug 21850: Remove search request from page title of OPAC result list
authorOwen Leonard <oleonard@myacpl.org>
Fri, 4 Jan 2019 15:26:05 +0000 (15:26 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 4 Feb 2019 15:58:20 +0000 (15:58 +0000)
This patch modifies the OPAC search results template so that advanced
search terms are not shown in the page title and breadcrumbs. This
removes potentially confusing computer-oriented code from the public
view.

For simple searches the search term is displayed, using the same logic
that determines whether the search bar should be populated with the last
search term.

To test:

 - Apply the patch
 - Peform a simple keyword search in the OPAC
   - On the results page the title and breadcrumbs should show 'Results
     of search for [your keyword]
 - Perform an advanced search with multiple parameters
   - The page title and breadrumbs should show only 'Search results'
   - The breadcrumbs should also show a link back to Advanced search
     using the returntosearch parameter

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: mikael <mikael.Olangcay-Brisebois@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt

index 548c0c0..5ecd8c4 100644 (file)
@@ -9,7 +9,11 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;
 [% IF ( searchdesc ) %]
-    Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
+    [% IF ( ms_value ) %]
+        Results of search for '[% ms_value | html %]'
+    [% ELSE %]
+        Search results
+    [% END %]
 [% ELSE %]
     You did not specify any search criteria.
 [% END %]</title>
     <div class="main">
         <ul class="breadcrumb">
             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
-            <li>
                 [% IF ( searchdesc ) %]
-                    <a href="#">Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</a>
+                    [% IF ( ReturnPath ) %]
+                        <li>
+                            <a href="[% ReturnPath | url %]">Advanced search</a> <span class="divider">&rsaquo;</span>
+                        </li>
+                    [% END %]
+                    <li>
+                        [% IF ( ms_value ) %]
+                            <a href="#">Results of search for '[% ms_value | html %]'</a>
+                        [% ELSE %]
+                            <a href="#">Search results</a>
+                        [% END %]
+                    </li>
                 [% ELSE %]
-                    <a href="#">You did not specify any search criteria</a>
+                    <li>
+                        <a href="#">You did not specify any search criteria</a>
+                    </li>
                 [% END %]
-            </li>
         </ul>
 
         [% UNLESS ( total ) %]
                     [% IF ( total ) %]
                         [% IF ( ReturnPath ) %]
                             <div class="returntosearch">
-                                <p><a href="[% ReturnPath | uri %]">Return to the last advanced search</a></p>
+                                <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
                             </div>
                         [% END %]
                     [% END %]