Browse Source

Fix white screen in article hero when image missing.

9471-orcid
Alexander O'Neill 3 years ago
parent
commit
34c68349b1
  1. 7
      templates/article_pages/article--hero.html.twig

7
templates/article_pages/article--hero.html.twig

@ -1,4 +1,7 @@
{% set imagePath = file_url(content.field_article_highlight_image|field_target_entity.image.entity.uri.value) %} {% set imageValue = content.field_article_highlight_image|field_target_entity.image.entity.uri.value %}
{% if imageValue %}
{% set imagePath = file_url(imageValue) %}
{% endif %}
{% set articleType = content.field_article_type|field_value %} {% set articleType = content.field_article_type|field_value %}
{% set pubDate = content.field_publication_date_electroni|field_value %} {% set pubDate = content.field_publication_date_electroni|field_value %}
@ -35,7 +38,7 @@
<header style="background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('{{ imagePath }}')" class="article-title-banner node__header paragraph-responsive-typography-enabled article-header"> <header style="background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)){% if imagePath %}, url('{{ imagePath }}'){% endif %}" class="article-title-banner node__header paragraph-responsive-typography-enabled article-header">
<div class="container article-info--wrapper"> <div class="container article-info--wrapper">
{% block title_area %} {% block title_area %}

Loading…
Cancel
Save