You are here

ckeditor-settings-toolbar.html.twig in Drupal 10

Theme override for the CKEditor settings toolbar.

Available variables:

  • multiple_buttons: A list of buttons that may be added multiple times.
  • disabled_buttons: A list of disabled buttons.
  • active_buttons: A list of active button rows.

File

core/themes/stable/templates/admin/ckeditor-settings-toolbar.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the CKEditor settings toolbar.
  5. *
  6. * Available variables:
  7. * - multiple_buttons: A list of buttons that may be added multiple times.
  8. * - disabled_buttons: A list of disabled buttons.
  9. * - active_buttons: A list of active button rows.
  10. *
  11. * @see template_preprocess_ckeditor_settings_toolbar()
  12. */
  13. #}
  14. {% apply spaceless %}
  15. <fieldset role="form" aria-labelledby="ckeditor-button-configuration ckeditor-button-description">
  16. <legend id="ckeditor-button-configuration">{{ 'Toolbar configuration'|t }}</legend>
  17. <div class="fieldset-wrapper">
  18. <div id="ckeditor-button-description" class="fieldset-description">
  19. {%- trans -%}
  20. Move a button into the <em>Active toolbar</em> to enable it, or into the list of <em>Available buttons</em> to disable it. Buttons may be moved with the mouse or keyboard arrow keys. Toolbar group names are provided to support screen reader users. Empty toolbar groups will be removed upon save.
  21. {%- endtrans -%}
  22. </div>
  23. <div class="ckeditor-toolbar-disabled clearfix">
  24. {# Available buttons. #}
  25. <div class="ckeditor-toolbar-available">
  26. <label for="ckeditor-available-buttons">{{ 'Available buttons'|t }}</label>
  27. <ul id="ckeditor-available-buttons" class="ckeditor-buttons clearfix" role="form" data-drupal-ckeditor-button-sorting="source">
  28. {% for disabled_button in disabled_buttons %}
  29. <li{{ disabled_button.attributes.addClass('ckeditor-button') }}>{{ disabled_button.value }}</li>
  30. {% endfor %}
  31. </ul>
  32. </div>
  33. {# Dividers. #}
  34. <div class="ckeditor-toolbar-dividers">
  35. <label for="ckeditor-multiple-buttons">{{ 'Button divider'|t }}</label>
  36. <ul id="ckeditor-multiple-buttons" class="ckeditor-multiple-buttons" role="form" data-drupal-ckeditor-button-sorting="dividers">
  37. {% for multiple_button in multiple_buttons %}
  38. <li{{ multiple_button.attributes.addClass('ckeditor-multiple-button') }}>{{ multiple_button.value }}</li>
  39. {% endfor %}
  40. </ul>
  41. </div>
  42. </div>
  43. {# Active toolbar. #}
  44. <div class="clearfix">
  45. <label id="ckeditor-active-toolbar">{{ 'Active toolbar'|t }}</label>
  46. </div>
  47. <div data-toolbar="active" role="form" class="ckeditor-toolbar ckeditor-toolbar-active clearfix">
  48. <ul class="ckeditor-active-toolbar-configuration" role="presentation" aria-label="{{ 'CKEditor toolbar and button configuration.'|t }}">
  49. {% for button_row in active_buttons %}
  50. <li class="ckeditor-row" role="group" aria-labelledby="ckeditor-active-toolbar">
  51. <ul class="ckeditor-toolbar-groups clearfix">
  52. {% for group_name, button_group in button_row %}
  53. <li class="ckeditor-toolbar-group" role="presentation" data-drupal-ckeditor-type="group" data-drupal-ckeditor-toolbar-group-name="{{ group_name }}" tabindex="0">
  54. <h3 class="ckeditor-toolbar-group-name" id="ckeditor-toolbar-group-aria-label-for-{{ button_group.group_name_class }}">{{ group_name }}</h3>
  55. <ul class="ckeditor-buttons ckeditor-toolbar-group-buttons" role="toolbar" data-drupal-ckeditor-button-sorting="target" aria-labelledby="ckeditor-toolbar-group-aria-label-for-{{ button_group.group_name_class }}">
  56. {% for active_button in button_group.buttons %}
  57. <li{{ active_button.attributes.addClass(active_button.multiple ? 'ckeditor-multiple-button' : 'ckeditor-button') }}>{{ active_button.value }}</li>
  58. {% endfor %}
  59. </ul>
  60. </li>
  61. {% endfor %}
  62. </ul>
  63. </li>
  64. {% else %}
  65. <li>
  66. <ul class="ckeditor-buttons"></ul>
  67. </li>
  68. {% endfor %}
  69. </ul>
  70. </div>
  71. </div>
  72. </fieldset>
  73. {% endapply %}