You are here

ingredient-recipeml-formatter.html.twig in Recipe 8.2

RecipeML theme implementation to display an ingredient.

Available variables:

  • quantity: The ingredient quantity.
  • unit_text: The full name of the ingredient quantity's unit.
  • unit_abbreviation: The abbreviated name of the ingredient quantity's unit.
  • unit_display: A flag that indicates whether to display the full name of the unit or the abbreviation.
  • name: The ingredient name.
  • note: The ingredient note.

File

templates/ingredient-recipeml-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * RecipeML theme implementation to display an ingredient.
  5. *
  6. * Available variables:
  7. * - quantity: The ingredient quantity.
  8. * - unit_text: The full name of the ingredient quantity's unit.
  9. * - unit_abbreviation: The abbreviated name of the ingredient quantity's unit.
  10. * - unit_display: A flag that indicates whether to display the full
  11. * name of the unit or the abbreviation.
  12. * - name: The ingredient name.
  13. * - note: The ingredient note.
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. <ing><amt><qty>{{ quantity|raw }}</qty>{% if unit_name %}{% if unit_display %}<unit>{{ unit_name }}</unit>{% else %}<unit>{{ unit_abbreviation }}</unit>{% endif %}{% endif %}</amt><item>{{ name }}</item>{% if note|length > 0 %}<prep>{{ note }}</prep>{% endif %}</ing>