filter-tips.html.twig

Same filename in this branch
  1. 10 core/profiles/demo_umami/themes/umami/templates/classy/content-edit/filter-tips.html.twig
  2. 10 core/themes/olivero/templates/filter/filter-tips.html.twig
  3. 10 core/themes/stable9/templates/content-edit/filter-tips.html.twig
  4. 10 core/themes/starterkit_theme/templates/content-edit/filter-tips.html.twig
  5. 10 core/modules/filter/templates/filter-tips.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/content-edit/filter-tips.html.twig
  2. 9 core/themes/olivero/templates/filter/filter-tips.html.twig
  3. 9 core/themes/stable9/templates/content-edit/filter-tips.html.twig
  4. 9 core/themes/seven/templates/classy/content-edit/filter-tips.html.twig
  5. 9 core/themes/claro/templates/filter/filter-tips.html.twig
  6. 9 core/themes/bartik/templates/classy/content-edit/filter-tips.html.twig
  7. 9 core/themes/stable/templates/content-edit/filter-tips.html.twig
  8. 9 core/themes/starterkit_theme/templates/content-edit/filter-tips.html.twig
  9. 9 core/themes/classy/templates/content-edit/filter-tips.html.twig
  10. 9 core/modules/filter/templates/filter-tips.html.twig
  11. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/content-edit/filter-tips.html.twig
  12. 8.9.x core/themes/seven/templates/classy/content-edit/filter-tips.html.twig
  13. 8.9.x core/themes/claro/templates/filter/filter-tips.html.twig
  14. 8.9.x core/themes/bartik/templates/classy/content-edit/filter-tips.html.twig
  15. 8.9.x core/themes/stable/templates/content-edit/filter-tips.html.twig
  16. 8.9.x core/themes/classy/templates/content-edit/filter-tips.html.twig
  17. 8.9.x core/modules/filter/templates/filter-tips.html.twig
  18. 11.x core/profiles/demo_umami/themes/umami/templates/classy/content-edit/filter-tips.html.twig
  19. 11.x core/themes/olivero/templates/filter/filter-tips.html.twig
  20. 11.x core/themes/stable9/templates/content-edit/filter-tips.html.twig
  21. 11.x core/themes/claro/templates/filter/filter-tips.html.twig
  22. 11.x core/themes/starterkit_theme/templates/content-edit/filter-tips.html.twig
  23. 11.x core/modules/filter/templates/filter-tips.html.twig

Theme override for a set of filter tips.

Available variables:

  • tips: Descriptions and a CSS ID in the form of 'module-name/filter-id' (only used when 'long' is TRUE) for each filter in one or more text formats.
  • long: A flag indicating whether the passed-in filter tips contain extended explanations, i.e. intended to be output on the path 'filter/tips' (TRUE), or are in a short format, i.e. suitable to be displayed below a form element. Defaults to FALSE.
  • multiple: A flag indicating there is more than one filter tip.

See also

template_preprocess_filter_tips()

claro_preprocess_filter_tips()

2 theme calls to filter-tips.html.twig
FilterController::filterTips in core/modules/filter/src/Controller/FilterController.php
Displays a page with long filter tips.
template_preprocess_filter_guidelines in core/modules/filter/filter.module
Prepares variables for text format guideline templates.

File

core/themes/claro/templates/filter/filter-tips.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a set of filter tips.
  5. *
  6. * Available variables:
  7. * - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id'
  8. * (only used when 'long' is TRUE) for each filter in one or more text
  9. * formats.
  10. * - long: A flag indicating whether the passed-in filter tips contain extended
  11. * explanations, i.e. intended to be output on the path 'filter/tips'
  12. * (TRUE), or are in a short format, i.e. suitable to be displayed below a
  13. * form element. Defaults to FALSE.
  14. * - multiple: A flag indicating there is more than one filter tip.
  15. *
  16. * @see template_preprocess_filter_tips()
  17. * @see claro_preprocess_filter_tips()
  18. */
  19. #}
  20. {% if multiple %}
  21. <h2>{{ 'Text Formats'|t }}</h2>
  22. {% endif %}
  23. {% if tips|length %}
  24. {% if multiple %}
  25. <div class="compose-tips">
  26. {% endif %}
  27. {% for name, tip in tips %}
  28. {% if multiple %}
  29. {%
  30. set tip_classes = [
  31. 'compose-tips__item',
  32. 'compose-tips__item--name-' ~ name|clean_class,
  33. ]
  34. %}
  35. <div{{ tip.attributes.addClass(tip_classes) }}>
  36. {% endif %}
  37. {% if multiple or long %}
  38. <h3>{{ tip.name }}</h3>
  39. {% endif %}
  40. {% if tip.list|length %}
  41. <ul class="filter-tips {{ long ? 'filter-tips--long' : 'filter-tips--short' }}">
  42. {% for item in tip.list %}
  43. {%
  44. set item_classes = [
  45. 'filter-tips__item',
  46. long ? 'filter-tips__item--long' : 'filter-tips__item--short',
  47. long ? 'filter-tips__item--id-' ~ item.id|clean_class,
  48. ]
  49. %}
  50. <li{{ item.attributes.addClass(item_classes) }}>{{ item.tip }}</li>
  51. {% endfor %}
  52. </ul>
  53. {% endif %}
  54. {% if multiple %}
  55. </div>
  56. {% endif %}
  57. {% endfor %}
  58. {% if multiple %}
  59. </div>
  60. {% endif %}
  61. {% endif %}

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