views-view--media-library.html.twig

Same filename in other branches
  1. 9 core/themes/claro/templates/media-library/views-view--media-library.html.twig
  2. 10 core/themes/claro/templates/media-library/views-view--media-library.html.twig
  3. 11.x core/themes/claro/templates/media-library/views-view--media-library.html.twig

Theme override for the media_library view template.

Exposed filters precede views header.

Available variables:

  • attributes: Remaining HTML attributes for the element.
  • 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_icons: Optional feed icons 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.
  • dom_id: Unique id for every view being printed to give unique class for Javascript.

See also

template_preprocess_views_view()

File

core/themes/claro/templates/media-library/views-view--media-library.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the media_library view template.
  5. *
  6. * Exposed filters precede views header.
  7. *
  8. * Available variables:
  9. * - attributes: Remaining HTML attributes for the element.
  10. * - css_name: A css-safe version of the view name.
  11. * - css_class: The user-specified classes names, if any.
  12. * - header: The optional header.
  13. * - footer: The optional footer.
  14. * - rows: The results of the view query, if any.
  15. * - empty: The content to display if there are no rows.
  16. * - pager: The optional pager next/prev links to display.
  17. * - exposed: Exposed widget form/info to display.
  18. * - feed_icons: Optional feed icons to display.
  19. * - more: An optional link to the next page of results.
  20. * - title: Title of the view, only used when displaying in the admin preview.
  21. * - title_prefix: Additional output populated by modules, intended to be
  22. * displayed in front of the view title.
  23. * - title_suffix: Additional output populated by modules, intended to be
  24. * displayed after the view title.
  25. * - attachment_before: An optional attachment view to be displayed before the
  26. * view content.
  27. * - attachment_after: An optional attachment view to be displayed after the
  28. * view content.
  29. * - dom_id: Unique id for every view being printed to give unique class for
  30. * Javascript.
  31. *
  32. * @see template_preprocess_views_view()
  33. */
  34. #}
  35. {%
  36. set classes = [
  37. 'view',
  38. 'view-' ~ id|clean_class,
  39. 'view-id-' ~ id,
  40. 'view-display-id-' ~ display_id,
  41. dom_id ? 'js-view-dom-id-' ~ dom_id,
  42. ]
  43. %}
  44. <div{{ attributes.addClass(classes) }}>
  45. {{ title_prefix }}
  46. {% if title %}
  47. {{ title }}
  48. {% endif %}
  49. {{ title_suffix }}
  50. {% if exposed %}
  51. <div class="view-filters">
  52. {{ exposed }}
  53. </div>
  54. {% endif %}
  55. {% if header %}
  56. <div class="view-header">
  57. {{ header }}
  58. </div>
  59. {% endif %}
  60. {% if attachment_before %}
  61. <div class="attachment attachment-before">
  62. {{ attachment_before }}
  63. </div>
  64. {% endif %}
  65. {% if rows %}
  66. <div class="view-content">
  67. {{ rows }}
  68. </div>
  69. {% elseif empty %}
  70. <div class="view-empty">
  71. {{ empty }}
  72. </div>
  73. {% endif %}
  74. {% if pager %}
  75. {{ pager }}
  76. {% endif %}
  77. {% if attachment_after %}
  78. <div class="attachment attachment-after">
  79. {{ attachment_after }}
  80. </div>
  81. {% endif %}
  82. {% if more %}
  83. {{ more }}
  84. {% endif %}
  85. {% if footer %}
  86. <div class="view-footer">
  87. {{ footer }}
  88. </div>
  89. {% endif %}
  90. {% if feed_icons %}
  91. <div class="feed-icons">
  92. {{ feed_icons }}
  93. </div>
  94. {% endif %}
  95. </div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.