I currently have an asset upload field, but I'm trying to make it call errors back if the image isn't an extension that's set within the field, allowing users to understand why the form didn't save.

  {% macro errorList(errors) %}
        {% if errors %}
            <ul class="errors">
                {% for error in errors %}
                    <li>{{ error }}</li>
                {% endfor %}
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

        <div class="form-group">
          <label>Featured Image</label>
          <div class="input-group">
            <div class="custom-file">
              <input id="inputGroupFile01" type="file" class="custom-file-input" name="fields[networkImage]">
              <label class="custom-file-label" for="inputGroupFile01">Choose file</label>

I can't seem to find any documentation on error calling for this certain scenario? Or a catch-all error for the form field would be great!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.