From 3e78c4a8df73e7197187fb276d5b4fac40f11c34 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 4 Sep 2019 17:42:02 +0000 Subject: [PATCH] Bug 22880: (follow-up) Define OpacHeader variable for conditional This follow-up uses the updates introduced by Bug 23253 as a model for improving the display of opacheader. Adding the OpacHeader variable allows the template to check for its existence and display some container markup around opacheader if it exists. This will help ease the transition for libraries who depend on the #opacheader id for styling. To test, apply the patch and test the OPAC with an 'opacheader' item defined. The content should be displayed on the page inside '
.' Delete the 'opacheader' news item and reload the OPAC page. There should no longer be an #opacheader div. --- koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 4cbffbf7852..a1bf382da11 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -4,6 +4,7 @@ [% USE Categories %] [% USE KohaNews %] [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] +[% SET OpacHeader = KohaNews.get( location => "opacheader", lang => news_lang, library => branchcode, blocktitle => 0 ) %]
- [% PROCESS koha_news_block news => KohaNews.get( location => "opacheader", lang => news_lang, library => branchcode, blocktitle => 0 ) %] + [% IF ( OpacHeader ) %] +
+
+
+ [% PROCESS koha_news_block news => OpacHeader %] +
+
+
+ [% END %]
-- 2.11.0