From e0122701aa9589b77f44e9a6cb20043aa19a8cbf Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 21 Oct 2014 12:52:54 -0400 Subject: [PATCH] Bug 13119 - Use XSLT to display tagged titles in the OPAC This patch updates the display of a logged-in user's tagged titles to use the same XSLT stylesheet used by search results and Lists. This would make for a more consistent display of information. Unrelated change: Corrected "My tags" header to read "Your tags," consistent with sidebar navigation. To test you should have multiple titles in your catalog which you have tagged in the OPAC. - Set the OPACXSLTResultsDisplay system preference to 'default' - Log in to the OPAC and view the "your tags" page. - Confirm that title information is displayed correctly. Compare to search results. - Empty the OPACXSLTResultsDisplay system preference and reload the "your tags" page. The display should revert to the old view, showing title, subtitle (if any) and author (if any). - Set the OPACXSLTResultsDisplay to a custom path pointing to a custom XSL file and confirm that the list of your tagged titles changes accordingly. Note: A follow-up will add "action" links ("place hold," "add to cart," etc) consistent with other pages. Signed-off-by: Frederic Demians Works as described. opac-tag.pl page displays tagged titles the same way as result & list pages. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/en/modules/opac-tags.tt | 22 +++++++++++++++---- opac/opac-tags.pl | 4 ++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt index 2811bd01cf..b9a7072193 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -113,7 +113,7 @@ [% IF ( MY_TAGS ) %]
-

My Tags

+

Your tags

@@ -124,9 +124,23 @@ [% MY_TAG.term |html %] + [% IF ( MY_TAG.XSLTBloc ) %] + [% MY_TAG.XSLTBloc %] + [% ELSE %] + Title: + + [% MY_TAG.title |html %] + [% IF ( MY_TAG.subtitle ) %] + [% FOREACH subtitle IN MY_TAG.subtitle %] + [% subtitle.subfield |html %] + [% END %] + [% END %] + + [% IF ( MY_TAG.author ) %] + by [% MY_TAG.author %] + [% END %] + [% END # /IF MY_TAG.XSLTBloc %] +
TermTitleDate addedDelete
- Title: - - [% MY_TAG.title |html %][% IF ( MY_TAG.subtitle ) %][% FOREACH subtitle IN MY_TAG.subtitle %] [% subtitle.subfield |html %][% END %][% END %] [% IF ( MY_TAG.author ) %]by [% MY_TAG.author %][% END %] Date added: diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 6c402a5d27..5a058d207c 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -42,6 +42,7 @@ use C4::Output qw(:html :ajax pagination_bar); use C4::Scrubber; use C4::Biblio; use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags); +use C4::XSLT; use Data::Dumper; @@ -232,6 +233,9 @@ if ($loggedinuser) { $_->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $_->{biblionumber} ) ); $_->{title} = $biblio->{title}; $_->{author} = $biblio->{author}; + if (C4::Context->preference("OPACXSLTResultsDisplay")) { + $_->{XSLTBloc} = XSLTParse4Display($_->{biblionumber}, $record, "OPACXSLTResultsDisplay"); + } my $date = $_->{date_created} || ''; $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; $_->{time_created_display} = $1; -- 2.39.5