footnote-list.html.twig in Footnotes 8.2
{# footnotes/footnote-list.html.twig #}
<ul class="footnotes">
{% for fn in footnotes %}
{% if fn.ref_id is iterable %}
{#
// Output footnote that has more than one reference to it in the body.
// The only difference is to insert backlinks to all references.
// Helper: we need to enumerate a, b, c...
#}
{% set abc = "abcdefghijklmnopqrstuvwxyz"|split('') %}
{% set i = 0 %}
<li class="footnote" id="{{ fn.fn_id }}"><a href="#{{ fn.ref_id.0 }}" class="footnote-label">{{ fn.value }}</a>
{% for ref in fn.ref_id %}
<a class="footnote-multi" href="#{{ ref }}">{{ attribute(abc, i) }}</a>
{% set i = i + 1 %}
{% endfor %}
{{ fn.text|raw }}</li>
{% else %}
{# Output normal footnote. #}
<li class="footnote" id="{{ fn.fn_id }}"><a class="footnote-label" href="#{{ fn.ref_id }}">{{ fn.value }}</a>{{ fn.text|raw }}</li>
{% endif %}
{% endfor %}
</ul>
File
templates/footnote-list.html.twig
View source
- {# footnotes/footnote-list.html.twig #}
- <ul class="footnotes">
- {% for fn in footnotes %}
- {% if fn.ref_id is iterable %}
- {#
- // Output footnote that has more than one reference to it in the body.
- // The only difference is to insert backlinks to all references.
- // Helper: we need to enumerate a, b, c...
- #}
- {% set abc = "abcdefghijklmnopqrstuvwxyz"|split('') %}
- {% set i = 0 %}
- <li class="footnote" id="{{ fn.fn_id }}"><a href="#{{ fn.ref_id.0 }}" class="footnote-label">{{ fn.value }}</a>
- {% for ref in fn.ref_id %}
- <a class="footnote-multi" href="#{{ ref }}">{{ attribute(abc, i) }}</a>
- {% set i = i + 1 %}
- {% endfor %}
- {{ fn.text|raw }}</li>
- {% else %}
- {# Output normal footnote. #}
- <li class="footnote" id="{{ fn.fn_id }}"><a class="footnote-label" href="#{{ fn.ref_id }}">{{ fn.value }}</a>{{ fn.text|raw }}</li>
- {% endif %}
- {% endfor %}
- </ul>