You are here

recipe-view-plain-text.html.twig in Recipe 8.2

A view template to display all the fields in a plain-text recipe.

Available variables:

  • view: The view in use.
  • recipes: The list of rows returned by the query. Each recipe contains the following keys:

    • fields: A list of fields, each one contains:

      • content: The output of the field.
      • raw: The raw data for the field, if it exists. This is NOT output safe.
      • handler: The Views field handler controlling this field.
      • label: The field's label text.
      • label_suffix: Colon after the label.
      • has_label_colon: A boolean indicating whether to display a colon after the label.
  • row_separator: Text used to separate multiple recipes.

File

templates/recipe-view-plain-text.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * A view template to display all the fields in a plain-text recipe.
  5. *
  6. * Available variables:
  7. * - view: The view in use.
  8. * - recipes: The list of rows returned by the query. Each recipe contains the
  9. * following keys:
  10. * - fields: A list of fields, each one contains:
  11. * - content: The output of the field.
  12. * - raw: The raw data for the field, if it exists. This is NOT output safe.
  13. * - handler: The Views field handler controlling this field.
  14. * - label: The field's label text.
  15. * - label_suffix: Colon after the label.
  16. * - has_label_colon: A boolean indicating whether to display a colon after
  17. * the label.
  18. * - row_separator: Text used to separate multiple recipes.
  19. *
  20. * @see template_preprocess_views_view_fields()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. {% for recipe in recipes %}
  26. {% for field in recipe.fields %}
  27. {% if field.label %}
  28. {{ field.label }}{{ field.label_suffix }}
  29. {% endif %}
  30. {{ field.content }}
  31. {% endfor %}
  32. {% if not loop.last %}{{ row_separator }}{% endif %}
  33. {% endfor %}