From d686009916ff70adbdbd9f76c28c3598f9d25e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Sat, 31 Aug 2019 09:04:33 -0400 Subject: [PATCH] Add a no-featured-image class and give some padding when no value in image field --- web/themes/custom/geofresco/src/global/_layout.scss | 5 +++++ .../custom/geofresco/src/templates/layout/node.html.twig | 1 + 2 files changed, 6 insertions(+) diff --git a/web/themes/custom/geofresco/src/global/_layout.scss b/web/themes/custom/geofresco/src/global/_layout.scss index a80ef80..de8b498 100644 --- a/web/themes/custom/geofresco/src/global/_layout.scss +++ b/web/themes/custom/geofresco/src/global/_layout.scss @@ -25,3 +25,8 @@ overflow: visible; z-index: 10; } + +/* If there's no featured image, leave enough blank space for the dropping down title. */ +.content.no-featured-image { + margin-top: 4rem; +} diff --git a/web/themes/custom/geofresco/src/templates/layout/node.html.twig b/web/themes/custom/geofresco/src/templates/layout/node.html.twig index 84b06b2..46e7cfb 100644 --- a/web/themes/custom/geofresco/src/templates/layout/node.html.twig +++ b/web/themes/custom/geofresco/src/templates/layout/node.html.twig @@ -80,6 +80,7 @@ node.isSticky() ? 'is-sticky', not node.isPublished() ? 'is-unpublished', view_mode ? view_mode|clean_class, 'clearfix', +content.field_image|render is empty ? 'no-featured-image', ] %}