Lays out content for blocks (left and/or right side of page). This template is optional, and can be overridden by copying the default template and modifying it.
The $block object includes:
- The name of the module that generated the block.
- The number of the block for a particular module.
- The block title.
- The html content for the block.
- Status of block (0 or 1).
- Region name, by default the available regions are 'left', 'right', 'header' and 'footer'.
- Throttle setting.
- The directory the theme is located in, e.g. themes/garland or themes/garland/minelli.
- True if the front page is currently being displayed.
- The sequential id of the block displayed, ie: The first block is 1, the second block is 2 etc.
- The same as $id, but is reset for the left and right sidebars.
- Alternates between 'odd' and 'even'. This is useful for creating 'zebra stripes' with your css.
- The same as $zebra, but is reset for the left and right sidebars.
block.tpl.php, which can be found at themes/engines/phptemplate/block.tpl.php.
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">
<?php if ($block->subject): ?>
<h2><?php print $block->subject ?></h2>
<div class="content"><?php print $block->content ?></div>
4.6 vs. 4.7 and higher
In 4.6 these variables are different:
$block->regiononly allows for Left (0), or Right(1) column.
In 4.7 and higher versions it is also possible to define custom regions in addition to the default 'left', 'right', 'header' and 'footer'.