Skip to content

Commit 3756da6

Browse files
authored
[4.0] Set sidebar countModule content aware (#32234)
* [4.0] Make sidecol countModule content aware Pull Request for Issue #32224 . ### Summary of Changes Makes sidebar-* countModules content-aware ### Testing Instructions 1. Enable only the Tag Similar module the sidebar-left postion 2. Open an article with no similar tags ### Before Blank space in sidebar-left position ### After No blank space in sidebar-left position ### Documentation Changes Required * apply to all positions
1 parent 133d085 commit 3756da6

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

templates/cassiopeia/index.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979

8080
$hasClass = '';
8181

82-
if ($this->countModules('sidebar-left'))
82+
if ($this->countModules('sidebar-left', true))
8383
{
8484
$hasClass .= ' has-sidebar-left';
8585
}
8686

87-
if ($this->countModules('sidebar-right'))
87+
if ($this->countModules('sidebar-right', true))
8888
{
8989
$hasClass .= ' has-sidebar-right';
9090
}
@@ -125,9 +125,9 @@
125125
<?php endif; ?>
126126
</div>
127127
</div>
128-
<?php if ($this->countModules('menu') || $this->countModules('search')) : ?>
128+
<?php if ($this->countModules('menu', true) || $this->countModules('search', true)) : ?>
129129
<div class="grid-child container-nav">
130-
<?php if ($this->countModules('menu')) : ?>
130+
<?php if ($this->countModules('menu', true)) : ?>
131131
<nav class="navbar navbar-expand-md">
132132
<?php HTMLHelper::_('bootstrap.collapse', '.navbar-toggler'); ?>
133133
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="<?php echo Text::_('TPL_CASSIOPEIA_TOGGLE'); ?>">
@@ -138,7 +138,7 @@
138138
</div>
139139
</nav>
140140
<?php endif; ?>
141-
<?php if ($this->countModules('search')) : ?>
141+
<?php if ($this->countModules('search', true)) : ?>
142142
<div class="container-search">
143143
<jdoc:include type="modules" name="search" style="none" />
144144
</div>
@@ -147,25 +147,25 @@
147147
<?php endif; ?>
148148
</header>
149149

150-
<?php if ($this->countModules('banner')) : ?>
150+
<?php if ($this->countModules('banner', true)) : ?>
151151
<div class="container-banner full-width">
152152
<jdoc:include type="modules" name="banner" style="none" />
153153
</div>
154154
<?php endif; ?>
155155

156-
<?php if ($this->countModules('top-a')) : ?>
156+
<?php if ($this->countModules('top-a', true)) : ?>
157157
<div class="grid-child container-top-a">
158158
<jdoc:include type="modules" name="top-a" style="card" />
159159
</div>
160160
<?php endif; ?>
161161

162-
<?php if ($this->countModules('top-b')) : ?>
162+
<?php if ($this->countModules('top-b', true)) : ?>
163163
<div class="grid-child container-top-b">
164164
<jdoc:include type="modules" name="top-b" style="card" />
165165
</div>
166166
<?php endif; ?>
167167

168-
<?php if ($this->countModules('sidebar-left')) : ?>
168+
<?php if ($this->countModules('sidebar-left', true)) : ?>
169169
<div class="grid-child container-sidebar-left">
170170
<jdoc:include type="modules" name="sidebar-left" style="card" />
171171
</div>
@@ -181,25 +181,25 @@
181181
<jdoc:include type="modules" name="main-bottom" style="card" />
182182
</div>
183183

184-
<?php if ($this->countModules('sidebar-right')) : ?>
184+
<?php if ($this->countModules('sidebar-right', true)) : ?>
185185
<div class="grid-child container-sidebar-right">
186186
<jdoc:include type="modules" name="sidebar-right" style="card" />
187187
</div>
188188
<?php endif; ?>
189189

190-
<?php if ($this->countModules('bottom-a')) : ?>
190+
<?php if ($this->countModules('bottom-a', true)) : ?>
191191
<div class="grid-child container-bottom-a">
192192
<jdoc:include type="modules" name="bottom-a" style="card" />
193193
</div>
194194
<?php endif; ?>
195195

196-
<?php if ($this->countModules('bottom-b')) : ?>
196+
<?php if ($this->countModules('bottom-b', true)) : ?>
197197
<div class="grid-child container-bottom-b">
198198
<jdoc:include type="modules" name="bottom-b" style="card" />
199199
</div>
200200
<?php endif; ?>
201201

202-
<?php if ($this->countModules('footer')) : ?>
202+
<?php if ($this->countModules('footer', true)) : ?>
203203
<footer class="container-footer footer full-width">
204204
<div class="grid-child">
205205
<jdoc:include type="modules" name="footer" style="none" />

0 commit comments

Comments
 (0)