From bbe0d7f5dda1a82271ad503ed696b0637989618c 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. Signed-off-by: Hayley Mapley Signed-off-by: Lisette Scheer --- 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 e7a03b301f..5b42784680 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