views-view-fields.html.twig

Default view template to display all the fields in a row.

Available variables:

  • view: The view in use.
  • 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.
    • class: The safe class ID to use.
    • handler: The Views field handler controlling this field.
    • inline: Whether or not the field should be inline.
    • inline_html: Either div or span based on the 'inline' flag.
    • wrapper_prefix: A complete wrapper containing the inline_html to use.
    • wrapper_suffix: The closing tag for the wrapper.
    • separator: An optional separator that may appear before a field.
    • label: The field's label text.
    • label_html: The full HTML of the label to use including configured element type.
  • row: The raw result from the query, with all data it fetched.

See also

template_preprocess()

template_preprocess_views_view_fields()

File

drupal/core/modules/views/templates/views-view-fields.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default view template to display all the fields in a row.
  5. *
  6. * Available variables:
  7. * - view: The view in use.
  8. * - fields: A list of fields, each one contains:
  9. * - content: The output of the field.
  10. * - raw: The raw data for the field, if it exists. This is NOT output safe.
  11. * - class: The safe class ID to use.
  12. * - handler: The Views field handler controlling this field.
  13. * - inline: Whether or not the field should be inline.
  14. * - inline_html: Either div or span based on the 'inline' flag.
  15. * - wrapper_prefix: A complete wrapper containing the inline_html to use.
  16. * - wrapper_suffix: The closing tag for the wrapper.
  17. * - separator: An optional separator that may appear before a field.
  18. * - label: The field's label text.
  19. * - label_html: The full HTML of the label to use including configured
  20. * element type.
  21. * - row: The raw result from the query, with all data it fetched.
  22. *
  23. * @see template_preprocess()
  24. * @see template_preprocess_views_view_fields()
  25. *
  26. * @ingroup themeable
  27. */
  28. #}
  29. <!--
  30. THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY.
  31. See http://api.drupal.org/api/function/theme_views_view_fields/8 for details.
  32. After copying this file to your theme's folder and customizing it, remove this
  33. HTML comment.
  34. -->
  35. {% for field in fields %}
  36. {{ field.separator }}
  37. {{ field.wrapper_prefix }}
  38. {{ field.label_html }}
  39. {{ field.content }}
  40. {{ field.wrapper_suffix }}
  41. {% endfor %}

Related topics