{% set special_message_type = ["secondary", "success", "danger", "warning", "info", "light", "dark"] %} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% if message_float is defined and message_float is true %}
{% endif %} {% for category, message in messages %} {% set category = category if category in special_message_type else 'primary' %} {% endfor %} {% if message_float is defined and message_float is true %}
{% endif %} {% endif %} {% endwith %}