inline-form-errors-summary.html.twig

Default theme implementation for the Inline Form Errors summary.

Available variables:

  • error_links: A list of render arrays for the errored elements, one link per element.
  • form_id: The form's machine ID; drives the theme suggestion inline_form_errors_summary__FORM_ID.
1 theme call to inline-form-errors-summary.html.twig
FormErrorHandler::displayErrorMessages in core/modules/inline_form_errors/src/FormErrorHandler.php
Loops through and displays all form errors.

File

core/modules/inline_form_errors/templates/inline-form-errors-summary.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the Inline Form Errors summary.
  5. *
  6. * Available variables:
  7. * - error_links: A list of render arrays for the errored elements, one link
  8. * per element.
  9. * - form_id: The form's machine ID; drives the theme suggestion
  10. * inline_form_errors_summary__FORM_ID.
  11. *
  12. * @ingroup themeable
  13. */
  14. #}
  15. {% if error_links %}
  16. {%- set count = error_links|length -%}
  17. {%- trans -%}
  18. <span>{{ count }} error has been found:</span>
  19. {%- plural count -%}
  20. <span>{{ count }} errors have been found:</span>
  21. {%- endtrans -%}
  22. {{ include('item-list.html.twig', {
  23. items: error_links,
  24. list_type: 'ul',
  25. wrapper_attributes: create_attribute(),
  26. context: {list_style: 'comma-list'},
  27. }) }}
  28. {% endif %}

Related topics


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