From 607d20bf77c09f91e2d116e21c23381fe6078d73 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 17 Jul 2018 15:54:06 +0000 Subject: [PATCH] Bug 16111: (follow-up) Fixes for simplicity and validation This patch simplifies the OPAC search results feed template by adding BLOCKs for a couple of repeated sections. The same is done for the feed URL in the search results template. This patch also makes some changes to the markup of the rss and Atom feeds to improve their validity. To test, apply the patch and perform a search in the OPAC. Clicking the RSS icon at the top of the search results page should bring up the RSS feed, which should render correctly. If you validate the source it should return only a couple of "recommendations:" - "Self reference doesn't match document location" - "Unregistered link relationship: search" Perform the same test with the Atom feed by modifying the URL of the RSS feed in your browser so that it ends in "format=atom" instead of "format=rss" The Atom feed has some more serious validation issues but should be functional. --- .../bootstrap/en/modules/opac-opensearch.tt | 129 ++++++++++++++------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 10 +- 2 files changed, 91 insertions(+), 48 deletions(-) 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 07d7cf9..1a4f5d2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -1,5 +1,47 @@ [% USE Koha %] +[% BLOCK item_description %] + + [% END %] + [% END %] + [% IF ( SyndeticsEnabled ) %] + [% IF ( SyndeticsCoverImages ) %] + [% IF ( SEARCH_RESULT.content_identifier_exists ) %] + + [% ELSE %] + + [% END %] + [% END %] + [% END %] + [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] + [% IF ( BakerTaylorEnabled ) %] + [% IF bt_id %] + See Baker & Taylor + [% END %] + [% END %] +

+ [% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author |html %]. [% END %] + [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place |html %] [% END %] + [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode |html %][% END %] + [% IF ( SEARCH_RESULT.publicationyear ) %] + [% SEARCH_RESULT.publicationyear |html %] + [% ELSE %] + [% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate |html %][% END %] + [% END %] + [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages |html %][% END %] + [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes |html %][% END %] + [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size |html %]. [% END %] + [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %] +

+ [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %] +

Place Hold on [% SEARCH_RESULT.title %]

+ [% END %] + ]]> +[% END %] +[% BLOCK feed_url %][% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi |uri %]&count=[% countrss |uri %]&offset=[% offset %]&sort_by=acqdate_dsc&format=[% END %] [% IF ( opensearchdescription ) %] [% LibraryName |html %] Search @@ -18,10 +60,10 @@ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> - <![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]> - [% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&format=rss - - + <![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]> + [% PROCESS feed_url %]rss + + [% total %] [% offset %] [% IF ( results_per_page ) %] @@ -29,34 +71,26 @@ [% ELSE %] 20 [% END %] - [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]