You are here

function _layout_plugin_preprocess_layout in Layout Plugin (obsolete, use core's Layout Discovery) 8

Prepares variables for layout templates.

We name it with an underscore so if there is ever a template called 'layout' that this preprocess function doesn't automatically get picked up.

Parameters

array &$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #settings, #layout
2 string references to '_layout_plugin_preprocess_layout'
LayoutPluginManager::alterThemeImplementations in src/Plugin/Layout/LayoutPluginManager.php
Modifies the theme implementations for the layouts that we registered.
PluginManagerTest::testAlterThemeImplementations in tests/src/Unit/PluginManagerTest.php
Tests layout theme implementations.

File

./layout_plugin.module, line 60
Hook implementations for Layout Plugin module.

Code

function _layout_plugin_preprocess_layout(&$variables) {
  $content = $variables['content'];
  $variables['settings'] = $content['#settings'] ?: [];
  $variables['layout'] = $content['#layout'] ?: [];
}