About
This plugin adds a footnote button to Redactor fields. Also, it adds new filters and functions to your Twig templates. — In the end you get what the plugin's name already says: Footnotes.
Features
- coexists with regular superscript texts that are not supposed to be footnotes
- numbers referring to footnotes can be anchor links → see instructions of plugin settings in screenshot below or see the setting in action
- identical footnote texts can either be listed as one footnote or separately → see instructions of plugin settings in screenshot below or see the setting in action
Implementing Twig templates
When "Enable anchor links" setting is off
{# render your Redactor field's contents while filtering all footnotes #}
{{ entry.textField | footnotes }}
{# render all collected footnotes #}
{% if footnotes_exist() %}
<ul>
{% for number, footnote in footnotes() %}
<li>
{{ number }} {{ footnote }}
</li>
{% endfor %}
</ul>
{% endif %}
When "Enable anchor links" setting is on
{# render your Redactor field's contents while filtering all footnotes #}
{{ entry.textField | footnotes }}
{# render all collected footnotes #}
{% if footnotes_exist() %}
<ul>
{% for number, footnote in footnotes() %}
<li id="footnote-{{ loop.index }}">
{{ number | raw }} – {{ loop.index }} – {{ footnote }}
<a href="#fnref:{{ loop.index }}">back</a>
</li>
{% endfor %}
</ul>
{% endif %}
- Installation Instructions
To install this plugin, copy the command above to your terminal.
- Active Installs
- 123
- License
- MIT
- Last release
- December 3, 2022
- Activity (30 days)
- 0Closed Issues0Open Issues0Merged PRs0Open PRs