template_preprocess_region

Versions
7
template_preprocess_region(&$variables)

Preprocess variables for region.tpl.php

Prepare the values passed to the theme_region function to be passed into a pluggable template engine. Uses the region name to generate a template file suggestions. If none are found, the default region.tpl.php is used.

See also

drupal_region_class()

@see region.tpl.php

Code

includes/theme.inc, line 2593

<?php
function template_preprocess_region(&$variables) {
  // Create the $content variable that templates expect.
  $variables['content'] = $variables['elements']['#children'];
  $variables['region'] = $variables['elements']['#region'];

  $region = drupal_region_class($variables['region']);
  $variables['classes_array'][] = $region;
  $variables['template_files'][] = $region;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.