Last active
August 29, 2015 14:10
-
-
Save fastnetwebdesign/2a9ba26d4606111e88ff to your computer and use it in GitHub Desktop.
pull module into Joomla html override or remove div if no module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Render modules inside this html override | |
$doc = JFactory::getDocument(); | |
$renderer = $doc->loadRenderer('modules'); | |
$raw = array('style' => 'xhtml'); | |
?> | |
<!-- remove the whole div if no module assigned in this position--> | |
<?php if (count(JModuleHelper::getModules('right-article'))): ?> | |
<div class="widgets"> | |
<!-- Render module inside this override --> | |
<?= $renderer->render('right-article', $raw, null); ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment