You are here

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.

File

templates/recipe-view-recipeml.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default template for recipe displays that use the RecipeML style.
  5. *
  6. * Available variables:
  7. * - recipes: The individual recipes containing the following elements:
  8. * - title: Recipe title.
  9. * - version: Recipe version, possibly a date or an actual version number.
  10. * - source: Recipe source.
  11. * - time_fields: An array of fields containing the following elements:
  12. * - type: Name of the time field.
  13. * - qty: Length of time.
  14. * - timeunit: Units of the length of time.
  15. * - yield_qty: Recipe yield quantity.
  16. * - yield_unit: Recipe yield units.
  17. * - description: Recipe description.
  18. * - ingredients: Recipe ingredients.
  19. * - directions: Recipe directions, i.e. instructions.
  20. *
  21. * @see template_preprocess_recipe_view_recipeml()
  22. *
  23. * @ingroup themeable
  24. */
  25. #}
  26. <?xml version="1.0" encoding="utf-8" ?>
  27. <!DOCTYPE recipeml PUBLIC "-//FormatData//DTD RecipeML 0.5//EN" "http://www.formatdata.com/recipeml/recipeml.dtd">
  28. <recipeml version="0.5" generator="http://drupal.org/project/recipe">
  29. {% if recipes|length > 1 -%}
  30. <menu>
  31. {% endif %}
  32. {% for recipe in recipes %}
  33. <recipe{{ recipe.attributes }}>
  34. <head>
  35. <title>{{ recipe.title }}</title>
  36. {% if recipe.version -%}
  37. <version>{{ recipe.version }}</version>
  38. {% endif %}
  39. {% if recipe.source -%}
  40. <source>{{ recipe.source }}</source>
  41. {% endif %}
  42. {% for time_field in recipe.time_fields -%}
  43. <preptime type="{{ time_field.type }}">
  44. <time>
  45. <qty>{{ time_field.qty }}</qty>
  46. <timeunit>{{ time_field.timeunit }}</timeunit>
  47. </time>
  48. </preptime>
  49. {% endfor %}
  50. {% if recipe.yield_qty -%}
  51. <yield>
  52. <qty>{{ recipe.yield_qty }}</qty>
  53. <unit>{{ recipe.yield_unit }}</unit>
  54. </yield>
  55. {% endif %}
  56. </head>
  57. {% if recipe.description -%}
  58. <description>{{ recipe.description }}</description>
  59. {% endif %}
  60. <ingredients>{{ recipe.ingredients }}</ingredients>
  61. <directions>{{ recipe.directions }}</directions>
  62. </recipe>
  63. {% endfor %}
  64. {% if recipes|length > 1 -%}
  65. </menu>
  66. {% endif %}
  67. </recipeml>