Adapt pattern deprecated in Twig 2.10 for compatibility in Twig 3+
As of Twig 2.10, use the filter filter instead, or an if condition inside the for body (if your condition depends on a variable updated inside the loop and you are not using the loop variable). Per tip on https://twig.symfony.com/doc/2.x/tags/for.html
This commit is contained in:
parent
9cf4362e07
commit
023119cea1
8 changed files with 22 additions and 22 deletions
|
@ -39,8 +39,8 @@
|
|||
#}
|
||||
<description>
|
||||
{% set one_and_done = false %}
|
||||
{% for item in items if not one_and_done %}
|
||||
{% if item.content['#paragraph'].type.0.entity.id == 'text' %}
|
||||
{% for item in items %}
|
||||
{% if item.content['#paragraph'].type.0.entity.id == 'text' and not one_and_done %}
|
||||
{% set one_and_done = true %}
|
||||
{{ item.content|render|escape }}
|
||||
{% endif %}
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
{% set title_paragraph_index = null %}
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
{{ paragraph }}
|
||||
|
@ -103,8 +103,8 @@
|
|||
<div class="container">
|
||||
<div class="flow content">
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if i is not same as(title_paragraph_index) %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and i is not same as(title_paragraph_index) %}
|
||||
{{ paragraph }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{{ paragraph }}
|
||||
{% endif %}
|
||||
|
|
|
@ -76,8 +76,8 @@
|
|||
{% set title_paragraph_index = null %}
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
{{ paragraph }}
|
||||
|
@ -123,8 +123,8 @@
|
|||
{% set walls_up = false %}
|
||||
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if i is not same as(title_paragraph_index) %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and i is not same as(title_paragraph_index) %}
|
||||
{% if paragraph['#paragraph'].field_style_escape_flow.value is not empty %}
|
||||
{% set bust_out = paragraph['#paragraph'].field_style_escape_flow.value %}
|
||||
{% endif %}
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
{% set title_paragraph_index = null %}
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
{{ paragraph }}
|
||||
|
@ -109,8 +109,8 @@
|
|||
{% set walls_up = false %}
|
||||
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if i is not same as(title_paragraph_index) %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and i is not same as(title_paragraph_index) %}
|
||||
{% if paragraph['#paragraph'].field_style_escape_flow.value is not empty %}
|
||||
{% set bust_out = paragraph['#paragraph'].field_style_escape_flow.value %}
|
||||
{% endif %}
|
||||
|
|
|
@ -77,8 +77,8 @@ BOW! BOW BEFORE MY POWER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|||
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{{ paragraph }}
|
||||
{% endif %}
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in content.field_body_paragraph %}
|
||||
{% if i|first != '#' and content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{{ paragraph }}
|
||||
{% endif %}
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
{% set title_paragraph_index = null %}
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if paragraphs.field_body_paragraph %}
|
||||
{% for i, paragraph in paragraphs.field_body_paragraph if i|first != '#' %}
|
||||
{% if paragraphs.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% for i, paragraph in paragraphs.field_body_paragraph %}
|
||||
{% if i|first != '#' and paragraphs.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
<div class="column is-one-third">
|
||||
|
|
Loading…
Reference in a new issue