Display Area only when Blocks are present

Submitted by krebbi - 3 years ago

To show in a Theme only the Areas with Blocks in it:

<?php
$a = new Area('Main');
$adump = $a->getAreaLayouts($c);
if (($a->getTotalBlocksInArea($c) > 0) || !empty($adump) || ($c->isEditMode())) {
    ?>
    <div>
        <?php
        $a->display($c);
        ?>		
    </div>
<?php } ?>
Stats Categories Tags
comments powered by Disqus