You are here

function template_preprocess_eck_entity in Entity Construction Kit (ECK) 8

Implements template_preprocess_HOOK().

File

./eck.module, line 279
Contains hook implementations.

Code

function template_preprocess_eck_entity(&$variables) {
  $variables['eck_entity'] = $variables['elements']['#eck_entity'];
  $variables['entity_type'] = $variables['eck_entity']
    ->getEntityTypeId();
  $variables['bundle'] = $variables['eck_entity']
    ->bundle();
  $variables['view_mode'] = $variables['elements']['#view_mode'];

  // Build the $content variable for templates.
  $variables += [
    'content' => [],
  ];
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}