From 0b9870d9ef709d6d08ec295988aee896cb041dd9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 28 Apr 2020 14:41:47 +0000 Subject: [PATCH] Bug 11994: Fix OpenSearch discovery in the OPAC This patch corrects the markup for the OpenSearchDescription XML document and adds (back) the link in the OPAC header which points to it. This will enable compatible browsers to offer the addition of the OPAC's keyword search as a search engine option. I've found documentation suggesting this feature is available (or at least was at one time) in Chrome and Safari, but in my test it only works in Firefox. To test, apply the patch and make sure the OPACBaseURL preference is set correctly. - Open the OPAC in Firefox (these instructions assume the latest version, currently v.75). - On the right side of the address bar you should see ". . ." Click it to trigger the menu. - You should see an "Add search engine" entry with your OPAC's icon. - Click to add the search engine. - Type a keyword to search in the address bar - A box should pop up below the address bar showing icons at the bottom for performing a search in various search engines. One of these icons should be the icon for your Koha OPAC. - Click the Koha OPAC icon and confirm that it triggers a keyword search in your OPAC. Signed-off-by: Katrin Fischer Signed-off-by: David Nind --- .../bootstrap/en/includes/doc-head-close.inc | 1 + .../bootstrap/en/modules/opac-opensearch.tt | 23 +++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc index ee84825445..681f425d48 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc @@ -46,6 +46,7 @@ [% END %] [% END %] [% IF ( Koha.Preference('OPACBaseURL') ) %] + [% END %] [% PROCESS cssinclude %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt index fb50f1e678..7b43110ddc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -5,15 +5,20 @@ [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF ( opensearchdescription ) %] - - [% LibraryName | html %] Search - Search the [% LibraryName | html %] - koha opac [% LibraryName | html %] - [% KohaAdminEmailAddress | html %] - - - + + [% LibraryNameTitle | html %] + Search the [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha library[% END %] catalog + UTF-8 + + [% IF ( Koha.Preference('OpacFavicon') ) %] + [% Koha.Preference('OpacFavicon') | url %] + [% ELSE %] + [% Koha.Preference('OPACBaseURL') | url %][% interface | url %]/[% theme | url %]/images/favicon.ico + [% END %] + + + + [% ELSE %] [% IF ( rss ) %] -- 2.11.0