You are here

function template_preprocess_recipe_yield in Recipe 8.2

Prepares variables for the recipe_yield template.

Default template: recipe_yield.html.twig.

Parameters

array $variables: An associative array containing:

  • yield: The content of the pseudo-field.
  • label: A string containing the pseudo-field's title.
  • label_display: The display settings for the label.

File

./recipe.module, line 235
Contains functions for Recipe node CRUD and display.

Code

function template_preprocess_recipe_yield(&$variables, $hook) {

  // Add the RDF metadata to the content_attributes.
  $mapping = [
    'properties' => [
      'schema:recipeYield',
    ],
  ];
  $variables['content_attributes'] = rdf_rdfa_attributes($mapping);
  $variables['label_hidden'] = $variables['label_display'] == 'hidden';
}