block.tpl.php

You are here

  1. 7 modules/block/block.tpl.php
  2. 4.7 themes/pushbutton/block.tpl.php
  3. 4.7 themes/bluemarine/block.tpl.php
  4. 4.7 themes/engines/phptemplate/block.tpl.php
  5. 5 themes/bluemarine/block.tpl.php
  6. 5 themes/engines/phptemplate/block.tpl.php
  7. 5 themes/garland/block.tpl.php
  8. 5 themes/pushbutton/block.tpl.php
  9. 6 modules/system/block.tpl.php
  10. 6 themes/pushbutton/block.tpl.php
  11. 6 themes/garland/block.tpl.php
  12. 6 themes/bluemarine/block.tpl.php

block.tpl.php

Theme implementation to display a block.

Available variables:

  • $block->subject: Block title.
  • $block->content: Block content.
  • $block->module: Module that generated the block.
  • $block->delta: This is a numeric id connected to each module.
  • $block->region: The block region embedding the current block.

Helper variables:

  • $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
  • $zebra: Same output as $block_zebra but independent of any block region.
  • $block_id: Counter dependent on each block region.
  • $id: Same output as $block_id but independent of any block region.
  • $is_front: Flags true when presented in the front page.
  • $logged_in: Flags true when the current user is a logged-in member.
  • $is_admin: Flags true when the current user is an administrator.

See also

template_preprocess()

template_preprocess_block()

1 theme call to block.tpl.php
theme_blocks in includes/theme.inc
Return a set of blocks available for the current user.

File

modules/system/block.tpl.php
View source
  1. <?php
  2. /**
  3. * @file block.tpl.php
  4. *
  5. * Theme implementation to display a block.
  6. *
  7. * Available variables:
  8. * - $block->subject: Block title.
  9. * - $block->content: Block content.
  10. * - $block->module: Module that generated the block.
  11. * - $block->delta: This is a numeric id connected to each module.
  12. * - $block->region: The block region embedding the current block.
  13. *
  14. * Helper variables:
  15. * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
  16. * - $zebra: Same output as $block_zebra but independent of any block region.
  17. * - $block_id: Counter dependent on each block region.
  18. * - $id: Same output as $block_id but independent of any block region.
  19. * - $is_front: Flags true when presented in the front page.
  20. * - $logged_in: Flags true when the current user is a logged-in member.
  21. * - $is_admin: Flags true when the current user is an administrator.
  22. *
  23. * @see template_preprocess()
  24. * @see template_preprocess_block()
  25. */
  26. ?>
  27. <div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">
  28. <?php if ($block->subject): ?>
  29. <h2><?php print $block->subject ?></h2>
  30. <?php endif;?>
  31. <div class="content">
  32. <?php print $block->content ?>
  33. </div>
  34. </div>