Skip to content

Instantly share code, notes, and snippets.

@fastnetwebdesign
Last active August 29, 2015 14:10
Show Gist options
  • Save fastnetwebdesign/2a9ba26d4606111e88ff to your computer and use it in GitHub Desktop.
Save fastnetwebdesign/2a9ba26d4606111e88ff to your computer and use it in GitHub Desktop.
pull module into Joomla html override or remove div if no module
<?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