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 '<div
id="opacheader"></div>.'

Delete the 'opacheader' news item and reload the OPAC page. There should
no longer be an #opacheader div.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-09-04 17:42:02 +00:00 committed by Martin Renvoize
parent 12074faff9
commit ba0eccdf8d
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@
[% USE Categories %]
[% USE KohaNews %]
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
[% SET OpacHeader = KohaNews.get( location => "opacheader", lang => lang, library => branchcode, blocktitle => 0 ) %]
[% SET OpacHeader = KohaNews.get( location => "opacheader", lang => news_lang, library => branchcode, blocktitle => 0 ) %]
<div id="wrap">
<div id="header-region" class="noprint">
<div class="navbar navbar-inverse navbar-static-top">
@ -145,7 +145,15 @@
</div> <!-- /navbar-inner -->
</div> <!-- /navbar -->
[% PROCESS koha_news_block news => KohaNews.get( location => "opacheader", lang => news_lang, library => branchcode, blocktitle => 0 ) %]
[% IF ( OpacHeader ) %]
<div class="container-fluid">
<div class="row-fluid">
<div id="opacheader">
[% PROCESS koha_news_block news => OpacHeader %]
</div>
</div>
</div>
[% END %]
</div> <!-- / header-region -->