You are here

function template_preprocess_crop_crop_summary in Crop API 8.2

Same name and namespace in other branches
  1. 8 crop.module \template_preprocess_crop_crop_summary()

Prepares variables for crop_crop summary template.

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

File

./crop.module, line 77
The Crop API Drupal module.

Code

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