Getting the name of an area from a block in a stack

Permalink
Hi

I am using the following in a block controller

$this->block->getAreaHandle()


But it comes back as "Main" - I think this is because the block is in a stack, which is then in an area.

How can I find out what the original name of the area is?

Thanks.

yolk
 
JohntheFish replied on at Permalink Reply
JohntheFish
Stacks all live in a pseudo-area. Its has the name 'Main', but not to be confused with the Main area of a page.
yolk replied on at Permalink Reply
yolk
I seem to have done this using this code within a block controller

if($bID)
{
   $db = Loader::db();
   $cbv = $db->GetRow("SELECT * FROM CollectionVersionBlocks WHERE bID = $bID");
   if($cbv && isset($cbv['cID']))
   {
      $csd = $db->GetRow("SELECT * FROM btCoreStackDisplay WHERE stID = " . intval($cbv['cID']) . " ORDER BY bID DESC ");
      if($csd && isset($csd['bID']))
      {
         $cbv = $db->GetRow("SELECT * FROM CollectionVersionBlocks WHERE bID = " . $csd['bID']);
         $arHandle = $cbv['arHandle'];
      }
   }
}