region.tpl.php

Default theme implementation to display a region.

Available variables:

  • $content: The content for this region, typically blocks.
  • $classes: String of classes that can be used to style contextually through CSS. It can be manipulated through the variable $classes_array from preprocess functions. The default values can be one or more of the following:

    • region: The current template type, i.e., "theming hook".
    • region-[name]: The name of the region with underscores replaced with dashes. For example, the page_top region would have a region-page-top class.
  • $region: The name of the region variable as defined in the theme's .info file.

Helper variables:

  • $classes_array: Array of html class attribute values. It is flattened into a string within the variable $classes.
  • $is_admin: Flags true when the current user is an administrator.
  • $is_front: Flags true when presented in the front page.
  • $logged_in: Flags true when the current user is a logged-in member.

See also

template_preprocess()

template_preprocess_region()

template_process()

37 string references to the theme hook from region.tpl.php

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

BlockInvalidRegionTestCase::testBlockInInvalidRegion in drupal/modules/block/block.test
Tests that blocks assigned to invalid regions work correctly.
BlockViewModuleDeltaAlterWebTest::testBlockViewModuleDeltaAlter in drupal/modules/block/block.test
Tests that the alter hook is called, even if the delta contains a hyphen.
block_add_block_form_submit in drupal/modules/block/block.admin.inc
Form submission handler for block_add_block_form().
block_admin_configure_submit in drupal/modules/block/block.admin.inc
Form submission handler for block_admin_configure().
block_admin_display_form in drupal/modules/block/block.admin.inc
Form constructor for the main block administration form.

... See full list

File

drupal/modules/system/region.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display a region.
  5. *
  6. * Available variables:
  7. * - $content: The content for this region, typically blocks.
  8. * - $classes: String of classes that can be used to style contextually through
  9. * CSS. It can be manipulated through the variable $classes_array from
  10. * preprocess functions. The default values can be one or more of the following:
  11. * - region: The current template type, i.e., "theming hook".
  12. * - region-[name]: The name of the region with underscores replaced with
  13. * dashes. For example, the page_top region would have a region-page-top class.
  14. * - $region: The name of the region variable as defined in the theme's .info file.
  15. *
  16. * Helper variables:
  17. * - $classes_array: Array of html class attribute values. It is flattened
  18. * into a string within the variable $classes.
  19. * - $is_admin: Flags true when the current user is an administrator.
  20. * - $is_front: Flags true when presented in the front page.
  21. * - $logged_in: Flags true when the current user is a logged-in member.
  22. *
  23. * @see template_preprocess()
  24. * @see template_preprocess_region()
  25. * @see template_process()
  26. *
  27. * @ingroup themeable
  28. */
  29. ?>
  30. <?php if ($content): ?>
  31. <div class="<?php print $classes; ?>">
  32. <?php print $content; ?>
  33. </div>
  34. <?php endif; ?>

Related topics