#1046394 by n8tron and JohnAlbin: Add first and last classes to blocks
[project/zen.git] / templates / block.tpl.php
1 <?php
2 /**
3 * @file
4 * Theme implementation to display a block.
5 *
6 * Available variables:
7 * - $title: Block title.
8 * - $content: Block content.
9 * - $block->module: Module that generated the block.
10 * - $block->delta: An ID for the block, unique within each module.
11 * - $block->region: The block region embedding the current block.
12 * - $edit_links: A list of contextual links for the block. It can be
13 * manipulated through the variable $edit_links_array from preprocess
14 * functions.
15 * - $classes: String of classes that can be used to style contextually through
16 * CSS. It can be manipulated through the variable $classes_array from
17 * preprocess functions. The default values can be one or more of the
18 * following:
19 * - block: The current template type, i.e., "theming hook".
20 * - block-[module]: The module generating the block. For example, the user
21 * module is responsible for handling the default user navigation block. In
22 * that case the class would be "block-user".
23 * - first: The first block in the region.
24 * - last: The last block in the region.
25 * - region-count-[x]: The position of the block in the list of blocks in the
26 * current region.
27 * - region-odd: An odd-numbered block of the list of blocks in the current
28 * region.
29 * - region-even: An even-numbered block of the list of blocks in the current
30 * region.
31 * - count-[x]: The position of the block in the list of blocks on the current
32 * page.
33 * - odd: An odd-numbered block of the list of blocks on the current page.
34 * - even: An even-numbered block of the list of blocks on the current page.
35 *
36 * Helper variables:
37 * - $classes_array: Array of html class attribute values. It is flattened
38 * into a string within the variable $classes.
39 * - $edit_links_array: An array of contextual links for the block.
40 * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
41 * - $zebra: Same output as $block_zebra but independent of any block region.
42 * - $block_id: Counter dependent on each block region.
43 * - $id: Same output as $block_id but independent of any block region.
44 * - $is_front: Flags true when presented in the front page.
45 * - $logged_in: Flags true when the current user is a logged-in member.
46 * - $is_admin: Flags true when the current user is an administrator.
47 * - $block_html_id: A valid HTML ID and guaranteed unique.
48 *
49 * @see template_preprocess()
50 * @see zen_preprocess()
51 * @see template_preprocess_block()
52 * @see zen_preprocess_block()
53 * @see zen_process()
54 */
55 ?>
56 <div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>">
57 <?php if ($title): ?>
58 <h2 class="title"><?php print $title; ?></h2>
59 <?php endif; ?>
60
61 <div class="content">
62 <?php print $content; ?>
63 </div>
64
65 <?php print $edit_links; ?>
66 </div> <!-- /.block -->