Skip to content
Snippets Groups Projects
Commit 35a9fe87 authored by Scott Euser's avatar Scott Euser
Browse files

twig deprecation fix

parent 95b6cc36
Branches 2.0.x
Tags 2.0.0
No related merge requests found
{% apply spaceless %}
{# footnotes/footnote-link.html.twig #}
<a class="footnote__citation js-footnote-citation" id="{{ fn.ref_id }}" title="{{ fn.text_clean }}" href="#{{ fn.fn_id }}">{{ fn.value|render|trim }}</a>
{% endapply %}
\ No newline at end of file
{# footnotes/footnote-link.html.twig #}
<a class="footnote__citation js-footnote-citation" id="{{ fn.ref_id }}" title="{{ fn.text_clean }}" href="#{{ fn.fn_id }}">{{ fn.value|render|trim }}</a>
{% apply spaceless %}
{# footnotes/footnote-links.html.twig #}
{%- if footnote_links -%}
<span class="footnote__citations-wrapper">
{%- for footnote_link in footnote_links -%}
{% if not loop.first %}
<span class="footnote__citation-separator">, </span>
{% endif %}
{{ footnote_link }}
{%- endfor -%}
</span>
{%- endif -%}
{% endapply %}
\ No newline at end of file
{# footnotes/footnote-links.html.twig #}
{%- if footnote_links -%}
<span class="footnote__citations-wrapper">
{%- for footnote_link in footnote_links -%}
{% if not loop.first %}
<span class="footnote__citation-separator">, </span>
{% endif %}
{{ footnote_link }}
{%- endfor -%}
</span>
{%- endif -%}
......@@ -3,41 +3,39 @@
block. Additionally, the footnotes_group ID should be remain in place.
Similarly, .js-is-auto is required to fix auto-numbering when grouping
together via JS. #}
{% apply spaceless %}
{% if footnotes|length > 0 %}
<ul class="footnotes js-footnotes"{{ is_block ? ' id="footnotes_group"' }}>
{% for footnote_id, footnote_group in footnotes %}
{% set first_footnote = footnote_group|first %}
{% if not first_footnote.is_same_text %}
{% if footnotes|length > 0 %}
<ul class="footnotes js-footnotes"{{ is_block ? ' id="footnotes_group"' }}>
{% for footnote_id, footnote_group in footnotes %}
{% set first_footnote = footnote_group|first %}
{% if not first_footnote.is_same_text %}
{# The texts are not the same, output each footnote as a separate
line even though they have the same backlink number. #}
{% for footnote in footnote_group %}
<li class="footnotes__item-wrapper js-footnote-reference">
<span class="footnotes__item-backlinks">
<a class="footnotes__item-backlink{{ footnote.is_auto ? ' js-is-auto' }}" href="#{{ footnote.ref_id }}" id="{{ footnote.fn_id }}">{{ footnote.backlink_value }}</a>
</span>
<span class="footnotes__item-text js-footnote-reference-text">{{ footnote.text|raw }}</span>
</li>
{% endfor %}
{% else %}
{# The values and texts are the same, combine them into a single
line and output multiple backlinks. #}
<li class="footnotes__item-wrapper js-footnote-reference {{ footnote_group|length > 1 ? ' has-multiple' }}">
{# The texts are not the same, output each footnote as a separate
line even though they have the same backlink number. #}
{% for footnote in footnote_group %}
<li class="footnotes__item-wrapper js-footnote-reference">
<span class="footnotes__item-backlinks">
{% for footnote in footnote_group %}
<a class="footnotes__item-backlink{{ footnote.is_auto ? ' js-is-auto' }}{{ loop.last ? '' : ' has-next' }}" href="#{{ footnote.ref_id }}" id="{{ footnote.fn_id }}">{{ footnote.backlink_value }}</a>
{% endfor %}
<a class="footnotes__item-backlink{{ footnote.is_auto ? ' js-is-auto' }}" href="#{{ footnote.ref_id }}" id="{{ footnote.fn_id }}">{{ footnote.backlink_value }}</a>
</span>
<span class="footnotes__item-text js-footnote-reference-text">{{ first_footnote.text|raw }}</span>
<span class="footnotes__item-text js-footnote-reference-text">{{ footnote.text|raw }}</span>
</li>
{% endif %}
{% endfor %}
</ul>
{% elseif is_block %}
{# Empty placeholder block is needed even if no footnotes when loaded via the Block. #}
<ul class="footnotes" id="footnotes_group"></ul>
{% endif %}
{% endapply %}
{% endfor %}
{% else %}
{# The values and texts are the same, combine them into a single
line and output multiple backlinks. #}
<li class="footnotes__item-wrapper js-footnote-reference {{ footnote_group|length > 1 ? ' has-multiple' }}">
<span class="footnotes__item-backlinks">
{% for footnote in footnote_group %}
<a class="footnotes__item-backlink{{ footnote.is_auto ? ' js-is-auto' }}{{ loop.last ? '' : ' has-next' }}" href="#{{ footnote.ref_id }}" id="{{ footnote.fn_id }}">{{ footnote.backlink_value }}</a>
{% endfor %}
</span>
<span class="footnotes__item-text js-footnote-reference-text">{{ first_footnote.text|raw }}</span>
</li>
{% endif %}
{% endfor %}
</ul>
{% elseif is_block %}
{# Empty placeholder block is needed even if no footnotes when loaded via the Block. #}
<ul class="footnotes" id="footnotes_group"></ul>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment