The areablock is the content construction kit for documents offered by pimcore.
The concept is like you know it already from the block element. The difference is that you can insert predefined "mini applications" called bricks into an areablock.

Integrate an areablock in a template
Similar to the other document editables, an areablock can be integrated in any document view template as follows:
<?php echo $this->areablock('myAreablock') ?>
advanced usage with allowed areas:
<?php echo $this->areablock('myAreablock',array( "allowed"=>array("iframe","googletagcloud","spacer","rssreader"), "group" => array( "First Group" => array("iframe", "spacer"), "Second Group" => array("rssreader") ), "params" => array( "iframe" => array( // some additional parameters / configuration for the brick type "iframe" "parameter1" => "value1", "parameter2" => "value2" ), "googletagcloud" => array( // additional parameter for the brick type "googletagcloud" "param1" => "value1" ) ))); ?>
Accessing the parameters by name from within the brick:
//echo the value of parameter named "param1" for this brick echo $this->param1;
Configuration
| Name |
Type |
Description |
|---|---|---|
| allowed |
array |
An array of area-ID's wich are allowed for this tag |
| params | array | Optional Parameter |
| group | array | Array with group configuration (see example above) |
| manual | bool | forces the manual mode, which enables a complete free implementation for areablocks, for example using real <table> elements ... example see blelow (since 1.4.5) |
| reload | bool | set to true, to force a reload in editmode after reordering items (default: false) (since 1.4.5) |
| toolbar | bool | set to false to not display the extra toolbar for areablocks (default: true) (since 1.4.5) |
| dontCheckEnabled |
bool | set to true to display all installed area bricks, regardless if they are enabled in the extension manager |
| limit | int | limit the amount of elements |
Methods
| Name |
Description |
|---|---|
How to create "bricks" for the areablock?
Using manual mode (since 1.4.5)
The manual mode offers you the possibility to deal with areablocks the way you like, this is for example useful with tables:
<?php $areaBlock = $this->areablock("myArea", array("manual" => true))->start(); ?> <table width="100%"> <?php while ($areaBlock->loop()) { ?> <?php $areaBlock->blockConstruct(); ?> <tr> <td> <?php $areaBlock->blockStart(); ?> <?php $areaBlock->content(); ?> <?php $areaBlock->blockEnd(); ?> </td> </tr> <?php $areaBlock->blockDestruct(); ?> <?php } ?> </table> <?php $areaBlock->end(); ?>