You are here

views-view-megarow-table.html.twig in Views Megarow 8

Default theme implementation for displaying a view as a table.

Available variables:

  • attributes: Remaining HTML attributes for the element.

    • class: HTML classes that can be used to style contextually through CSS.
  • title : The title of this group of rows.
  • header: The table header columns.
    • attributes: Remaining HTML attributes for the element.
    • content: HTML classes to apply to each header cell, indexed by

    the header's key.

  • caption_needed: Is the caption tag needed.
  • caption: The caption for this table.
  • accessibility_description: Extended description for the table details.
  • accessibility_summary: Summary for the table details.
  • rows: Table row items. Rows are keyed by row number.
    • attributes: HTML classes to apply to each row.
    • columns: Row column items. Columns are keyed by column number.
      • attributes: HTML classes to apply to each column.
      • content: The column content.

File

templates/views-view-megarow-table.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for displaying a view as a table.
  5. *
  6. * Available variables:
  7. * - attributes: Remaining HTML attributes for the element.
  8. * - class: HTML classes that can be used to style contextually through CSS.
  9. * - title : The title of this group of rows.
  10. * - header: The table header columns.
  11. * - attributes: Remaining HTML attributes for the element.
  12. * - content: HTML classes to apply to each header cell, indexed by
  13. * the header's key.
  14. * - caption_needed: Is the caption tag needed.
  15. * - caption: The caption for this table.
  16. * - accessibility_description: Extended description for the table details.
  17. * - accessibility_summary: Summary for the table details.
  18. * - rows: Table row items. Rows are keyed by row number.
  19. * - attributes: HTML classes to apply to each row.
  20. * - columns: Row column items. Columns are keyed by column number.
  21. * - attributes: HTML classes to apply to each column.
  22. * - content: The column content.
  23. *
  24. * @see template_preprocess_views_view_table()
  25. *
  26. * @ingroup themeable
  27. */
  28. #}
  29. aaaa
  30. <table{{ attributes }}>
  31. {% if caption_needed %}
  32. <caption>
  33. {% if caption %}
  34. {{ caption }}
  35. {% else %}
  36. {{ title }}
  37. {% endif %}
  38. {% if (summary is not empty) or (description is not empty) %}
  39. <details>
  40. {% if summary is not empty %}
  41. <summary>{{ summary }}</summary>
  42. {% endif %}
  43. {% if description is not empty %}
  44. {{ description }}
  45. {% endif %}
  46. </details>
  47. {% endif %}
  48. </caption>
  49. {% endif %}
  50. {% if header %}
  51. <thead>
  52. <tr>
  53. {% for column in header %}
  54. <th{{ column.attributes }} scope="col">
  55. {{ column.content }}
  56. </th>
  57. {% endfor %}
  58. </tr>
  59. </thead>
  60. {% endif %}
  61. <tbody>
  62. {% for row in rows %}
  63. <tr{{ row.attributes }}>
  64. {% for column in row.columns %}
  65. <td{{ column.attributes }}>
  66. {{ column.content }}
  67. </td>
  68. {% endfor %}
  69. </tr>
  70. {% endfor %}
  71. </tbody>
  72. </table>