system-themes-page.html.twig

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

Default theme implementation 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., 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.

See also

template_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/modules/system/templates/system-themes-page.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * 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. *
  29. * @see template_preprocess_system_themes_page()
  30. *
  31. * @ingroup themeable
  32. */
  33. #}
  34. <div{{ attributes }}>
  35. {% for theme_group in theme_groups %}
  36. {%
  37. set theme_group_classes = [
  38. 'system-themes-list',
  39. 'system-themes-list-' ~ theme_group.state,
  40. 'clearfix',
  41. ]
  42. %}
  43. <div{{ theme_group.attributes.addClass(theme_group_classes) }}>
  44. <h2 class="system-themes-list__header">{{ theme_group.title }}</h2>
  45. {% for theme in theme_group.themes %}
  46. {%
  47. set theme_classes = [
  48. theme.is_default ? 'theme-default',
  49. theme.is_admin ? 'theme-admin',
  50. 'theme-selector',
  51. 'clearfix',
  52. ]
  53. %}
  54. <div{{ theme.attributes.addClass(theme_classes) }}>
  55. {% if theme.screenshot %}
  56. {{ theme.screenshot }}
  57. {% endif %}
  58. <div class="theme-info">
  59. <h3 class="theme-info__header">
  60. {{- theme.name }} {{ theme.version -}}
  61. {% if theme.notes %}
  62. ({{ theme.notes|safe_join(', ') }})
  63. {%- endif -%}
  64. </h3>
  65. <div class="theme-info__description">{{ theme.description }}</div>
  66. {% if theme.module_dependencies %}
  67. <div class="theme-info__requires">
  68. {{ 'Requires: @module_dependencies'|t({'@module_dependencies': theme.module_dependencies|render}) }}
  69. </div>
  70. {% endif %}
  71. {# Display operation links if the theme is compatible. #}
  72. {% if theme.incompatible %}
  73. <div class="incompatible">{{ theme.incompatible }}</div>
  74. {% else %}
  75. {{ theme.operations }}
  76. {% endif %}
  77. </div>
  78. </div>
  79. {% endfor %}
  80. </div>
  81. {% endfor %}
  82. </div>

Related topics


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