You are here

function template_preprocess_relation in Relation 8.2

Same name and namespace in other branches
  1. 8 relation.module \template_preprocess_relation()

Prepares variables for relation templates.

Default template: relation.html.twig.

File

./relation.module, line 58
Describes relations between entities.

Code

function template_preprocess_relation(&$variables) {
  $variables['relation'] = $variables['elements']['#relation'];
  $variables += array(
    'content' => array(),
  );
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}