diff --git a/themes/intotheeast/templates/dailies.html.twig b/themes/intotheeast/templates/dailies.html.twig index 9511f35..955d5fb 100644 --- a/themes/intotheeast/templates/dailies.html.twig +++ b/themes/intotheeast/templates/dailies.html.twig @@ -112,12 +112,6 @@ feedMap.on('load', function () { {% if all_items|length > 0 %} {% for item in all_items %} {% set entry = item.page %} - {% set hero = null %} - {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} - {% set hero = entry.media[entry.header.hero_image] %} - {% elseif entry.media.images|length > 0 %} - {% set hero = entry.media.images|first %} - {% endif %} {% if item.type == 'journal' %} {% set weather_icons = { @@ -168,6 +162,12 @@ feedMap.on('load', function () {
{{ entry.content|raw }}
{% else %} + {% set hero = null %} + {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} + {% set hero = entry.media[entry.header.hero_image] %} + {% elseif entry.media.images|length > 0 %} + {% set hero = entry.media.images|first %} + {% endif %} {% if hero %}
diff --git a/themes/intotheeast/templates/home.html.twig b/themes/intotheeast/templates/home.html.twig index f460130..984e350 100644 --- a/themes/intotheeast/templates/home.html.twig +++ b/themes/intotheeast/templates/home.html.twig @@ -51,12 +51,6 @@ {% if all_items|length > 0 %} {% for item in all_items %} {% set entry = item.page %} - {% set hero = null %} - {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} - {% set hero = entry.media[entry.header.hero_image] %} - {% elseif entry.media.images|length > 0 %} - {% set hero = entry.media.images|first %} - {% endif %} {% if item.type == 'journal' %} {% set weather_icons = { @@ -107,6 +101,12 @@
{{ entry.content|raw }}
{% else %} + {% set hero = null %} + {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} + {% set hero = entry.media[entry.header.hero_image] %} + {% elseif entry.media.images|length > 0 %} + {% set hero = entry.media.images|first %} + {% endif %}
{% if hero %}
diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index a42b98e..1774c2e 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -214,12 +214,6 @@ {% if all_items|length > 0 %} {% for item in all_items %} {% set entry = item.page %} - {% set hero = null %} - {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} - {% set hero = entry.media[entry.header.hero_image] %} - {% elseif entry.media.images|length > 0 %} - {% set hero = entry.media.images|first %} - {% endif %} {% if item.type == 'journal' %} {% set weather_icons = { @@ -270,6 +264,12 @@
{{ entry.content|raw }}
{% else %} + {% set hero = null %} + {% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %} + {% set hero = entry.media[entry.header.hero_image] %} + {% elseif entry.media.images|length > 0 %} + {% set hero = entry.media.images|first %} + {% endif %}
{% if hero %}