code/extensions/BlocksSiteTreeExtension.php
/**
	 * Called from templates to get rendered blocks for the given area
	 * @param string $area
	 * @param integer $limit Limit the items to this number, or null for no limit
	 */
Called from templates to get rendered blocks for the given area
@param string $area
@param integer $limit Limit the items to this number, or null for no limit
Called from templates to get rendered blocks for the given area @param string $area @param integer $limit Limit the items to this number or null for no limit
public function BlockArea($area, $limit = null) {
		if ($this->owner->ID <= 0) return; 
		$list = $this->getBlockList($area);
		foreach ($list as $block) {
			if (!$block->canView()) {
				$list->remove($block);
			}
		}
		if ($limit !== null) {
			$list = $list->limit($limit);
		}
		$data['BlockArea'] = $list;
		$data['AreaID'] = $area;
		$data = $this->owner->customise($data);
		$template[] = 'BlockArea_' . $area;
		if (SSViewer::hasTemplate($template)) {
			return $data->renderWith($template);
		} else {
			return $data->renderWith('BlockArea');
		}
	}
public function BlockArea ( $ area , $ limit = null ) { if ( $ this -> owner -> ID <= 0 ) return ; $ list = $ this -> getBlockList ( $ area ) ; foreach ( $ list as $ block ) { if ( ! $ block -> canView ( ) ) { $ list -> remove ( $ block ) ; } } if ( $ limit !== null ) { $ list = $ list -> limit ( $ limit ) ; } $ data [ 'BlockArea' ] = $ list ; $ data [ 'AreaID' ] = $ area ; $ data = $ this -> owner -> customise ( $ data ) ; $ template [ ] = 'BlockArea_' . $ area ; if ( SSViewer :: hasTemplate ( $ template ) ) { return $ data -> renderWith ( $ template ) ; } else { return $ data -> renderWith ( 'BlockArea' ) ; } }
Called from templates to get rendered blocks for the given area
 @param string $area
 @param integer $limit Limit the items to this number, or null for no limit
Called from templates to get rendered blocks for the given area @param string $area @param integer $limit Limit the items to this number or null for no limit
// blocks break on fake pages ie Security/login