getTotalBlocksInArea($c) is not working on layouts. Is this a bug?
Permalink
When an area contains only a layout with blocks within it, it is not finding this with the getTotalBlocksInArea($c) function. Is there another function I should be using to determine if there are layouts which are populated? Here is my code snippet...
<?php $a = new Area('Main'); if ($a->getTotalBlocksInArea($c) > 0 || $c->isEditMode()) { ?> <div class="centered"> <div class="extra-block"> <?=$a->display($c);?> </div> </div> <?php } ?>
i'Ve just got that problem twice and I just figured out that it was due to this. I think this should be look into :-)
In case anyone comes across this in the future, I've posted a fix here:
http://www.concrete5.org/community/forums/usage/layout-makes-blocks...
http://www.concrete5.org/community/forums/usage/layout-makes-blocks...
im not sure if its a bug, but we should have a way of getting the area names in an area