media-reference-help.html.twig

Same filename in this branch
  1. 10 core/themes/stable9/templates/content/media-reference-help.html.twig
Same filename in other branches
  1. 9 core/themes/stable9/templates/content/media-reference-help.html.twig
  2. 9 core/themes/stable/templates/content/media-reference-help.html.twig
  3. 9 core/modules/media/templates/media-reference-help.html.twig
  4. 8.9.x core/themes/stable/templates/content/media-reference-help.html.twig
  5. 8.9.x core/modules/media/templates/media-reference-help.html.twig
  6. 11.x core/themes/stable9/templates/content/media-reference-help.html.twig
  7. 11.x core/modules/media/templates/media-reference-help.html.twig

Theme override for media reference fields.

See also

template_preprocess_field_multiple_value_form()

File

core/modules/media/templates/media-reference-help.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for media reference fields.
  5. *
  6. * @see template_preprocess_field_multiple_value_form()
  7. */
  8. #}
  9. {%
  10. set classes = [
  11. 'js-form-item',
  12. 'form-item',
  13. 'js-form-wrapper',
  14. 'form-wrapper',
  15. ]
  16. %}
  17. <fieldset{{ attributes.addClass(classes) }}>
  18. {%
  19. set legend_span_classes = [
  20. 'fieldset-legend',
  21. required ? 'js-form-required',
  22. required ? 'form-required',
  23. ]
  24. %}
  25. {# Always wrap fieldset legends in a <span> for CSS positioning. #}
  26. <legend{{ legend_attributes }}>
  27. <span{{ legend_span_attributes.addClass(legend_span_classes) }}>{{ original_label }}</span>
  28. </legend>
  29. <div class="js-form-item form-item">
  30. {% if media_add_help %}
  31. <h4{{ header_attributes.addClass('label') }}>
  32. {% trans %}
  33. Create new media
  34. {% endtrans %}
  35. </h4><br />
  36. <div class="description">
  37. {{ media_add_help }}
  38. </div>
  39. {% endif %}
  40. {% if multiple %}
  41. {{ table }}
  42. {% else %}
  43. {% for element in elements %}
  44. {{ element }}
  45. {% endfor %}
  46. {% endif %}
  47. <div{{ description.attributes.addClass('description') }}>
  48. {% if multiple and description.content %}
  49. <ul>
  50. <li>{{ media_list_help }} {{ media_list_link }} {{ allowed_types_help }}</li>
  51. <li>{{ description.content }}</li>
  52. </ul>
  53. {% else %}
  54. {{ media_list_help }} {{ media_list_link }} {{ allowed_types_help }}
  55. {% endif %}
  56. {% if multiple and button %}
  57. <div class="clearfix">{{ button }}</div>
  58. {% endif %}
  59. </div>
  60. </div>
  61. </fieldset>

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