recipe-view-recipeml.html.twig in Recipe 8.2
Default template for recipe displays that use the RecipeML style.
Available variables:
- recipes: The individual recipes containing the following elements:
- title: Recipe title.
- version: Recipe version, possibly a date or an actual version number.
- source: Recipe source.
- time_fields: An array of fields containing the following elements:
- type: Name of the time field.
- qty: Length of time.
- timeunit: Units of the length of time.
- yield_qty: Recipe yield quantity.
- yield_unit: Recipe yield units.
- description: Recipe description.
- ingredients: Recipe ingredients.
- directions: Recipe directions, i.e. instructions.
See also
File
templates/recipe-view-recipeml.html.twigView source
- {#
- /**
- * @file
- * Default template for recipe displays that use the RecipeML style.
- *
- * Available variables:
- * - recipes: The individual recipes containing the following elements:
- * - title: Recipe title.
- * - version: Recipe version, possibly a date or an actual version number.
- * - source: Recipe source.
- * - time_fields: An array of fields containing the following elements:
- * - type: Name of the time field.
- * - qty: Length of time.
- * - timeunit: Units of the length of time.
- * - yield_qty: Recipe yield quantity.
- * - yield_unit: Recipe yield units.
- * - description: Recipe description.
- * - ingredients: Recipe ingredients.
- * - directions: Recipe directions, i.e. instructions.
- *
- * @see template_preprocess_recipe_view_recipeml()
- *
- * @ingroup themeable
- */
- #}
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE recipeml PUBLIC "-//FormatData//DTD RecipeML 0.5//EN" "http://www.formatdata.com/recipeml/recipeml.dtd">
- <recipeml version="0.5" generator="http://drupal.org/project/recipe">
- {% if recipes|length > 1 -%}
- <menu>
- {% endif %}
- {% for recipe in recipes %}
- <recipe{{ recipe.attributes }}>
- <head>
- <title>{{ recipe.title }}</title>
- {% if recipe.version -%}
- <version>{{ recipe.version }}</version>
- {% endif %}
- {% if recipe.source -%}
- <source>{{ recipe.source }}</source>
- {% endif %}
- {% for time_field in recipe.time_fields -%}
- <preptime type="{{ time_field.type }}">
- <time>
- <qty>{{ time_field.qty }}</qty>
- <timeunit>{{ time_field.timeunit }}</timeunit>
- </time>
- </preptime>
- {% endfor %}
- {% if recipe.yield_qty -%}
- <yield>
- <qty>{{ recipe.yield_qty }}</qty>
- <unit>{{ recipe.yield_unit }}</unit>
- </yield>
- {% endif %}
- </head>
- {% if recipe.description -%}
- <description>{{ recipe.description }}</description>
- {% endif %}
- <ingredients>{{ recipe.ingredients }}</ingredients>
- <directions>{{ recipe.directions }}</directions>
- </recipe>
- {% endfor %}
- {% if recipes|length > 1 -%}
- </menu>
- {% endif %}
- </recipeml>