{% load wagtailcore_tags i18n %} {% if page.footnotes_list %}

{% translate "Footnotes" %}

    {% for footnote in page.footnotes_list %} {% with footnote_index=forloop.counter %}
  1. {% if footnote.references|length == 1 %} {# If there is only a single reference, link the return icon back to it #} {% else %} ↩ {% for reference_index in footnote.references %} {# If there are multiple references, generate unique links per reference #} {# Display a 1-indexed counter for each of the references to this footnote #} {{ forloop.counter }} {% endfor %} {% endif %} {{ footnote.text|richtext }}
  2. {% endwith %} {% endfor %}
{% endif %}