You are here

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
  1. {# footnotes/footnote-list.html.twig #}
  2. <ul class="footnotes">
  3. {% for fn in footnotes %}
  4. {% if fn.ref_id is iterable %}
  5. {#
  6. // Output footnote that has more than one reference to it in the body.
  7. // The only difference is to insert backlinks to all references.
  8. // Helper: we need to enumerate a, b, c...
  9. #}
  10. {% set abc = "abcdefghijklmnopqrstuvwxyz"|split('') %}
  11. {% set i = 0 %}
  12. <li class="footnote" id="{{ fn.fn_id }}"><a href="#{{ fn.ref_id.0 }}" class="footnote-label">{{ fn.value }}</a>
  13. {% for ref in fn.ref_id %}
  14. <a class="footnote-multi" href="#{{ ref }}">{{ attribute(abc, i) }}</a>
  15. {% set i = i + 1 %}
  16. {% endfor %}
  17. {{ fn.text|raw }}</li>
  18. {% else %}
  19. {# Output normal footnote. #}
  20. <li class="footnote" id="{{ fn.fn_id }}"><a class="footnote-label" href="#{{ fn.ref_id }}">{{ fn.value }}</a>{{ fn.text|raw }}</li>
  21. {% endif %}
  22. {% endfor %}
  23. </ul>