You are here

function template_preprocess_geysir_field_paragraph_wrapper in Geysir 8

Prepares variables for Geysir Field Paragraph wrapper templates.

Default template: geysir-field-paragraph-wrapper.html.twig.

Parameters

array $vars: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: .

File

./geysir.theme.inc, line 20
Geysir theming functionalities.

Code

function template_preprocess_geysir_field_paragraph_wrapper(array &$vars) {
  $element = $vars['element'];
  $paragraph = $element['#paragraph'];
  $vars['attributes']['data-geysir-paragraph-id'] = $paragraph ? $paragraph
    ->id() : 0;
  $vars['attributes']['class'][] = Html::cleanCssIdentifier('geysir-field-paragraph-wrapper');
  $vars['attributes']['class'][] = $paragraph ? Html::cleanCssIdentifier('geysir-field-paragraph-wrapper--type--' . $paragraph
    ->getType()) : '';
  $vars['content'] = $element['#children'];
  $vars['links'] = $element['#geysir_field_paragraph_links'];
}