8.5.x theme.inc template_preprocess_region(&$variables)
8.0.x theme.inc template_preprocess_region(&$variables)
8.1.x theme.inc template_preprocess_region(&$variables)
8.2.x theme.inc template_preprocess_region(&$variables)
8.3.x theme.inc template_preprocess_region(&$variables)
8.4.x theme.inc template_preprocess_region(&$variables)
8.6.x theme.inc template_preprocess_region(&$variables)
7.x theme.inc template_preprocess_region(&$variables)

Prepares variables for region templates.

Default template: region.html.twig.

Prepares 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.

Parameters

array $variables: An associative array containing:

  • elements: An associative array containing properties of the region.

File

core/includes/theme.inc, line 1514
The theme system, which controls the output of Drupal.

Code

function template_preprocess_region(&$variables) {

  // Create the $content variable that templates expect.
  $variables['content'] = $variables['elements']['#children'];
  $variables['region'] = $variables['elements']['#region'];
}