Page list Custom template - test if there are blocks in area/layouts

Permalink
Hi gang,

I am trying to create a custom template for the page list block but I am stuck on how I can access both areas and area-layouts for the list of pages inside view.php.

I get an error Call to undefined method Concrete\Core\Area\Area::getAreaLayouts()

<?php foreach ($pages as $page):
// Either of the two ways below fail
   $area = new Area('Main');
   $layouts = $area->getAreaLayouts($page);
// Method 2
   $alayouts = $page->getArea('Main')->getAreaLayouts($page);
?>


Using Concrete5 5.7.5.6

 
martbase replied on at Permalink Reply
Hi everyone,

With the recent updates to 5.7 is there an elegant solution to test if there are any blocks in an area or within area layouts.

I require this to conditionally include or exclude markup thus avoiding unwanted div's and empty markup in the generated html.