4 * Default theme implementation for status messages.
6 * Displays status, error, and warning messages, grouped by type.
8 * An invisible heading identifies the messages for assistive technology.
9 * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html
12 * Add an ARIA label to the contentinfo area so that assistive technology
13 * user agents will better describe this landmark.
15 * Available variables:
16 * - message_list: List of messages to be displayed, grouped by type.
17 * - status_headings: List of all status types.
18 * - display: (optional) May have a value of 'status' or 'error' when only
19 * displaying messages of that specific type.
20 * - attributes: HTML attributes for the element, including:
21 * - class: HTML classes.
25 * @see template_preprocess_status_messages()
29 set status_heading = {
30 'status': 'Status message'|t,
31 'error': 'Error message'|t,
32 'warning': 'Warning message'|t,
33 'info': 'Informative message'|t,
37 set status_classes = {
44 {% for type, messages in message_list %}
48 'alert-' ~ status_classes[type],
52 <div{{ attributes.addClass(classes) }} role="alert">
53 <a href="#" role="button" class="close" data-dismiss="alert" aria-label="{{ 'Close'|t }}"><span aria-hidden="true">×</span></a>
54 {% if status_headings[type] %}
55 <h4 class="sr-only">{{ status_headings[type] }}</h4>
57 {% if messages|length > 1 %}
58 <ul class="item-list item-list--messages">
59 {% for message in messages %}
60 <li class="item item--message">{{ message }}</li>