region.tpl.php

Default theme implementation to display a region.

Available variables:

  • $content: The content for this region, typically blocks.
  • $attributes: An instance of Attributes class that can be manipulated as an array and printed as a string. It includes the 'class' information, which includes:

    • 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:

  • $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()

File

drupal/core/modules/system/templates/region.tpl.php
View source
<?php

/**
 * @file
 * Default theme implementation to display a region.
 *
 * Available variables:
 * - $content: The content for this region, typically blocks.
 * - $attributes: An instance of Attributes class that can be manipulated as an
 *    array and printed as a string.
 *    It includes the 'class' information, which includes:
 *   - 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:
 * - $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 template_preprocess()
 * @see template_preprocess_region()
 * @see template_process()
 *
 * @ingroup themeable
 */
if ($content) {
  ?>
  <div <?php

  print $attributes;
  ?>>
    <?php

  print $content;
  ?>
  </div>
<?php

}

Related topics