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'];
      }
   }
}

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.