{% with messages = get_alerts() -%} {% if messages -%} {%- endif %} {%- endwith %} {% block content %} {% endblock content %}