You are here

function template_preprocess_smart_title in Smart Title 8

Implements template_preprocess_hook() for smart_title.

Prepares variables for smart title template.

Default template: smart-title.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the whole element. Properties used: #tag, #attributes, #children.

File

./smart_title.module, line 60
Contains hooks and private functions of smart_title.module.

Code

function template_preprocess_smart_title(array &$variables) {
  $element = $variables['element'];
  $element += [
    '#attributes' => [],
  ];
  $variables['children'] = $element['#children'];
  $variables['attributes'] = $element['#attributes'];
  $variables['tag'] = Html::escape($element['#tag']);
}