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.
1 theme call to ingredient-recipeml-formatter.html.twig
- IngredientRecipeMLFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ IngredientRecipeMLFormatter.php - Builds a renderable array for a field value.
File
templates/ingredient-recipeml-formatter.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @ingroup themeable
- */
- #}
- <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>