Wrap main-top and main-bottom positions in conditional divs

Both positions already existed but rendered unconditionally.
Now wrapped with $this->countModules() checks so the containing
<div> only renders when modules are assigned to the position.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 21:33:14 -05:00
parent a25f0cb2ea
commit cd59cf3eb8

View File

@@ -460,12 +460,20 @@ $wa->useScript('user.js'); // js/user.js
<div class="grid-child container-component">
<jdoc:include type="modules" name="breadcrumbs" style="none" />
<jdoc:include type="modules" name="main-top" style="card" />
<?php if ($this->countModules('main-top', true)) : ?>
<div class="container-main-top">
<jdoc:include type="modules" name="main-top" style="card" />
</div>
<?php endif; ?>
<jdoc:include type="message" />
<main id="maincontent" role="main">
<jdoc:include type="component" />
</main>
<jdoc:include type="modules" name="main-bottom" style="card" />
<?php if ($this->countModules('main-bottom', true)) : ?>
<div class="container-main-bottom">
<jdoc:include type="modules" name="main-bottom" style="card" />
</div>
<?php endif; ?>
</div>
<?php if ($this->countModules('sidebar-right', true)) : ?>