You are here

function template_preprocess_automated_crop_summary in Automated Crop 8

Prepares variables for automated_crop summary template.

Default template: automated-crop-summary.twig.html.

File

./automated_crop.module, line 24
The Automated Crop Drupal module.

Code

function template_preprocess_automated_crop_summary(&$variables) {
  if (!empty($variables['data']['automated_crop'])) {
    $type = \Drupal::entityTypeManager()
      ->getStorage('crop_type')
      ->load($variables['data']['crop_type']);
    $variables['data']['automated_crop'] = $type
      ->label();
  }
}