Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. theme.inc

function template_preprocess_region

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 1380

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal