The following methods are available when working with areas.

$area->getCollectionID()

Gets the page ID of the Area's current page.

$area->getAreaCollectionObject()

Gets the page object of the current Area.

$area->getAreaID()

Returns the current area's ID.

$area->getAreaHandle()

Returns the handle of the area object.

$area->getCustomTemplates()

Returns all custom templates defined within the area.

$area->setCustomTemplate($btHandle, $template)

Sets a custom template for all blocks of a certain type within an area.

$area->getTotalBlocksInArea($page = false)

Returns the total number of blocks in an area. Page must either be passed here, or if $area->display($page) has already been run, it can be omitted.

$area->setBlockLimit($number)

Limits the number of blocks in an area.

$area-> setBlockWrapperStart($html)

The passed $html will be printed out before every block in the area.

$area->setBlockWrapperEnd($html)

The passed $html will be printed out after every block in the area.

$area->display($page)

outputs all blocks within that area on the passed page. Typically used within page templates.

Recent Discussions on this Topic

page type displaying blocks automatically

::Programmatically:: I am trying to understand how by using page types I can have a block appear on the page when a user selects the page type when adding a page. Lets say would like to have an add block appear in the sidebar area automatically when t…