Connecting to LinkedIn...

errors.liquid

Displaying errors with a form's submitted data is useful case for a snippet which could be named _errors.liquid.

The file can be included within form tags like this:

{% form 'login_customer' %}
  {% include 'errors' %}
  ...
{% endform %}

Example content:

{% if form.errors %}
  <div class="flash-error">
    <h2>Whoops</h2>
    <ul>
      {% for text in form.errors %}
        <li>{{ text }}</li>
      {% endfor %}
    </ul>
  </div>
{% endif %}