Do not show a tab if the content is falsy
There may be occasions where plugin does not wish to show any output for the current user/page. In that case the tab should not be shown at all. SPR-895
This commit is contained in:
parent
45129fb497
commit
e5d40c9a7e
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
|
|||
<li class="a11y"> </li>
|
||||
<?php
|
||||
foreach($tabs as $tab) {
|
||||
if (empty($tab['tab']) || trim($tab['tab']) === '') {
|
||||
continue;
|
||||
}
|
||||
echo '<li>';
|
||||
echo '<a href="#' . $tab['id'] . '" aria-expanded="false">';
|
||||
echo '<span class="prefix">';
|
||||
|
@ -27,6 +30,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
|
|||
<div class="box-content">
|
||||
<?php
|
||||
foreach($tabs as $tab) {
|
||||
if (empty($tab['tab']) || trim($tab['tab']) === '') {
|
||||
continue;
|
||||
}
|
||||
echo '<div id="' . $tab['id'] . '" class="tab-pane" aria-hidden="true">';
|
||||
echo $tab['tab'];
|
||||
echo '</div>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue