system-themes-page.html.twig

Same filename in this branch
  1. main core/themes/stable9/templates/admin/system-themes-page.html.twig
  2. main core/themes/claro/templates/system-themes-page.html.twig
  3. main core/modules/system/templates/system-themes-page.html.twig
Same filename and directory in other branches
  1. 10 core/themes/stable9/templates/admin/system-themes-page.html.twig
  2. 10 core/themes/claro/templates/system-themes-page.html.twig
  3. 11.x core/themes/stable9/templates/admin/system-themes-page.html.twig
  4. 11.x core/themes/claro/templates/system-themes-page.html.twig
  5. 11.x core/modules/system/templates/system-themes-page.html.twig
  6. 10 core/modules/system/templates/system-themes-page.html.twig
  7. 9 core/themes/stable9/templates/admin/system-themes-page.html.twig
  8. 9 core/themes/claro/templates/system-themes-page.html.twig
  9. 9 core/themes/stable/templates/admin/system-themes-page.html.twig
  10. 9 core/modules/system/templates/system-themes-page.html.twig
  11. 8.9.x core/themes/claro/templates/system-themes-page.html.twig
  12. 8.9.x core/themes/stable/templates/admin/system-themes-page.html.twig
  13. 8.9.x core/modules/system/templates/system-themes-page.html.twig
  14. 11.x core/themes/admin/templates/system/system-themes-page.html.twig

Theme override for the Appearance page.

Available variables:

  • attributes: HTML attributes for the main container.
  • theme_groups: A list of theme groups. Each theme group contains:
    • attributes: HTML attributes specific to this theme group.
    • title: Title for the theme group.
    • state: State of the theme group, e.g. installed or uninstalled.
    • themes: A list of themes within the theme group. Each theme contains:
      • attributes: HTML attributes specific to this theme.
      • screenshot: A screenshot representing the theme.
      • description: Description of the theme.
      • name: Theme name.
      • version: The theme's version number.
      • is_default: Boolean indicating whether the theme is the default theme or not.
      • is_admin: Boolean indicating whether the theme is the Admin theme or not.
      • notes: Identifies what context this theme is being used in, e.g., the default theme, Admin theme.
      • incompatible: Text describing any compatibility issues.
      • module_dependencies: A list of modules that this theme requires.
      • operations: A list of operation links, e.g., Settings, Enable, Disable, etc. these links should only be displayed if the theme is compatible.
      • title_id: The unique id of the theme label.
      • description_id: The unique id of the theme description. This is undefined if the description is casted to an empty string.

See also

template_preprocess_system_themes_page()

gin_preprocess_system_themes_page()

1 theme call to system-themes-page.html.twig
SystemController::themesPage in core/modules/system/src/Controller/SystemController.php
Returns a theme listing which excludes obsolete themes.

File

core/themes/admin/templates/system/system-themes-page.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the Appearance page.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the main container.
  8. * - theme_groups: A list of theme groups. Each theme group contains:
  9. * - attributes: HTML attributes specific to this theme group.
  10. * - title: Title for the theme group.
  11. * - state: State of the theme group, e.g. installed or uninstalled.
  12. * - themes: A list of themes within the theme group. Each theme contains:
  13. * - attributes: HTML attributes specific to this theme.
  14. * - screenshot: A screenshot representing the theme.
  15. * - description: Description of the theme.
  16. * - name: Theme name.
  17. * - version: The theme's version number.
  18. * - is_default: Boolean indicating whether the theme is the default theme
  19. * or not.
  20. * - is_admin: Boolean indicating whether the theme is the Admin theme or
  21. * not.
  22. * - notes: Identifies what context this theme is being used in, e.g.,
  23. * the default theme, Admin theme.
  24. * - incompatible: Text describing any compatibility issues.
  25. * - module_dependencies: A list of modules that this theme requires.
  26. * - operations: A list of operation links, e.g., Settings, Enable, Disable,
  27. * etc. these links should only be displayed if the theme is compatible.
  28. * - title_id: The unique id of the theme label.
  29. * - description_id: The unique id of the theme description. This is
  30. * undefined if the description is casted to an empty string.
  31. *
  32. * @see template_preprocess_system_themes_page()
  33. * @see gin_preprocess_system_themes_page()
  34. */
  35. #}
  36. <div{{ attributes }}>
  37. {% for theme_group in theme_groups %}
  38. {%
  39. set theme_group_classes = [
  40. 'system-themes-list',
  41. 'system-themes-list--' ~ theme_group.state,
  42. 'clearfix',
  43. 'gin-layer-wrapper',
  44. ]
  45. %}
  46. {%
  47. set card_alignment = theme_group.state == 'installed' ? 'horizontal' : 'vertical'
  48. %}
  49. {% if not loop.first %}
  50. <hr>
  51. {% endif %}
  52. <div{{ theme_group.attributes.addClass(theme_group_classes) }}>
  53. <h2 class="system-themes-list__header">{{ theme_group.title }}</h2>
  54. <div class="card-list {{ card_alignment == 'horizontal' ? 'card-list--two-cols' : 'card-list--four-cols' }}">
  55. {% for theme in theme_group.themes %}
  56. {%
  57. set theme_classes = [
  58. theme.is_default ? 'theme-default',
  59. theme.is_admin ? 'theme-admin',
  60. 'card',
  61. 'card--' ~ card_alignment,
  62. 'card-list__item',
  63. ]
  64. %}
  65. {%
  66. set theme_title_classes = [
  67. 'card__content-item',
  68. 'heading-f',
  69. ]
  70. %}
  71. {%
  72. set theme_description_classes = [
  73. 'card__content-item',
  74. ]
  75. %}
  76. <div{{ theme.attributes.addClass(theme_classes).setAttribute('aria-labelledby', theme.title_id).setAttribute('aria-describedby', theme.description_id ?: null) }}>
  77. {% if theme.screenshot %}
  78. <div class="card__image">
  79. {{ theme.screenshot }}
  80. </div>
  81. {% endif %}
  82. <div class="card__content-wrapper">
  83. <div class="card__content">
  84. <h3{{ create_attribute({'id': theme.title_id}).addClass(theme_title_classes) }} id={{ theme.title_id }}>
  85. {{- theme.name }} {{ theme.version -}}
  86. {% if theme.notes %}
  87. ({{ theme.notes|safe_join(', ') }})
  88. {%- endif -%}
  89. </h3>
  90. {% if theme.description and theme.description_id %}
  91. <div{{ create_attribute({'id': theme.description_id ?: null}).addClass(theme_description_classes) }}>
  92. {{ theme.description }}
  93. </div>
  94. {%- endif -%}
  95. </div>
  96. <div class="card__footer">
  97. {% if theme.module_dependencies %}
  98. <div class="theme-info__requires">
  99. {{ 'Requires: @module_dependencies'|t({ '@module_dependencies': theme.module_dependencies|render }) }}
  100. </div>
  101. {% endif %}
  102. {# Display operation links only if the theme is compatible. #}
  103. {% if theme.incompatible %}
  104. <small class="incompatible">{{ theme.incompatible }}</small>
  105. {% else %}
  106. {{ theme.operations }}
  107. {% endif %}
  108. </div>
  109. </div>
  110. </div>
  111. {% endfor %}
  112. </div>
  113. </div>
  114. {% endfor %}
  115. </div>

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