views-view--frontpage.html.twig

Default theme implementation for the frontpage view template.

Available variables:

  • attributes: Remaining HTML attributes for the element including:

    • class: HTML classes that can be used to style contextually through CSS, including:

      • view
      • view-[css_name]
      • view-id-[view_name]
      • view-display-id-[display_name]
      • view-dom-id-[dom_id]
  • css_name: A css-safe version of the view name.
  • css_class: The user-specified classes names, if any.
  • header: The optional header.
  • footer: The optional footer.
  • rows: The results of the view query, if any.
  • empty: The content to display if there are no rows.
  • pager: The optional pager next/prev links to display.
  • exposed: Exposed widget form/info to display.
  • feed_icon: An optional feed icon to display.
  • more: An optional link to the next page of results.
  • title: Title of the view, only used when displaying in the admin preview.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the view title.
  • title_suffix: Additional output populated by modules, intended to be displayed after the view title.
  • attachment_before: An optional attachment view to be displayed before the view content.
  • attachment_after: An optional attachment view to be displayed after the view content.

See also

template_preprocess()

template_preprocess_views_view()

File

drupal/core/modules/views/tests/views_test_data/templates/views-view--frontpage.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the frontpage view template.
  5. *
  6. * Available variables:
  7. * - attributes: Remaining HTML attributes for the element including:
  8. * - class: HTML classes that can be used to style contextually
  9. * through CSS, including:
  10. * - view
  11. * - view-[css_name]
  12. * - view-id-[view_name]
  13. * - view-display-id-[display_name]
  14. * - view-dom-id-[dom_id]
  15. * - css_name: A css-safe version of the view name.
  16. * - css_class: The user-specified classes names, if any.
  17. * - header: The optional header.
  18. * - footer: The optional footer.
  19. * - rows: The results of the view query, if any.
  20. * - empty: The content to display if there are no rows.
  21. * - pager: The optional pager next/prev links to display.
  22. * - exposed: Exposed widget form/info to display.
  23. * - feed_icon: An optional feed icon to display.
  24. * - more: An optional link to the next page of results.
  25. * - title: Title of the view, only used when displaying in the admin preview.
  26. * - title_prefix: Additional output populated by modules, intended to be
  27. * displayed in front of the view title.
  28. * - title_suffix: Additional output populated by modules, intended to be
  29. * displayed after the view title.
  30. * - attachment_before: An optional attachment view to be displayed before the
  31. * view content.
  32. * - attachment_after: An optional attachment view to be displayed after the
  33. * view content.
  34. *
  35. * @see template_preprocess()
  36. * @see template_preprocess_views_view()
  37. *
  38. * @ingroup themeable
  39. */
  40. #}
  41. <div{{ attributes }}>
  42. {% if header %}
  43. <div class="view-header">
  44. {{ header }}
  45. </div>
  46. {% endif %}
  47. {% if exposed %}
  48. <div class="view-filters">
  49. {{ exposed }}
  50. </div>
  51. {% endif %}
  52. {% if attachment_before %}
  53. <div class="attachment attachment-before">
  54. {{ attachment_before }}
  55. </div>
  56. {% endif %}
  57. {% if rows %}
  58. <div class="view-content">
  59. {{ rows }}
  60. </div>
  61. {% elseif empty %}
  62. <div class="view-empty">
  63. {{ empty }}
  64. </div>
  65. {% endif %}
  66. {% if pager %}
  67. {{ pager }}
  68. {% endif %}
  69. {% if attachment_after %}
  70. <div class="attachment attachment-after">
  71. {{ attachment_after }}
  72. </div>
  73. {% endif %}
  74. {% if more %}
  75. {{ more }}
  76. {% endif %}
  77. {% if footer %}
  78. <div class="view-footer">
  79. {{ footer }}
  80. </div>
  81. {% endif %}
  82. {% if feed_icon %}
  83. <div class="feed-icon">
  84. {{ feed_icon }}
  85. </div>
  86. {% endif %}
  87. </div>

Related topics