From e99895a986390325fdb87bd21a005096970b495b Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Mon, 29 Jul 2024 16:35:36 +0300 Subject: [PATCH 1/3] UHF-10191: Change the organization default image on job listing page to useresponsive image style --- public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index f5603805..6a02edba 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -88,11 +88,14 @@ function hdbt_subtheme_preprocess_organization_information_block(array &$variabl // Set organization default image variable. if (!empty($organization) && !empty($organization->get("field_default_image")->first())) { $variables['content']['organization_default_image'] = $organization->get("field_default_image")->first()->view([ - 'type' => 'image', + 'type' => 'responsive_image', 'label' => 'hidden', 'settings' => [ - 'image_style' => '3_2_m_2x', + 'responsive_image_style' => 'job_listing_org', 'image_link' => '', + 'image_loading' => [ + 'attribute' => 'eager', + ], ], ]); } From d985000df87cdf0824203b546a6a37c0b934c51f Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Mon, 29 Jul 2024 16:44:18 +0300 Subject: [PATCH 2/3] UHF-10191: Change the Organization taxonomy term and the Job listing node to use responsive image style on organization images --- ...re.entity_view_display.node.job_listing.default.yml | 10 +++------- ...view_display.taxonomy_term.organization.default.yml | 10 +++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/conf/cmi/core.entity_view_display.node.job_listing.default.yml b/conf/cmi/core.entity_view_display.node.job_listing.default.yml index b42c74bb..b143487b 100644 --- a/conf/cmi/core.entity_view_display.node.job_listing.default.yml +++ b/conf/cmi/core.entity_view_display.node.job_listing.default.yml @@ -34,12 +34,10 @@ dependencies: - field.field.node.job_listing.field_task_area - field.field.node.job_listing.field_video - field.field.node.job_listing.job_description - - image.style.3_2_m_2x - node.type.job_listing module: - datetime - link - - media - text - user id: node.job_listing.default @@ -79,13 +77,11 @@ content: weight: 0 region: content field_image: - type: media_thumbnail + type: entity_reference_entity_view label: hidden settings: - image_link: '' - image_style: 3_2_m_2x - image_loading: - attribute: lazy + view_mode: job_listing_organization + link: false third_party_settings: { } weight: 15 region: content diff --git a/conf/cmi/core.entity_view_display.taxonomy_term.organization.default.yml b/conf/cmi/core.entity_view_display.taxonomy_term.organization.default.yml index 378ad47b..2084c92e 100644 --- a/conf/cmi/core.entity_view_display.taxonomy_term.organization.default.yml +++ b/conf/cmi/core.entity_view_display.taxonomy_term.organization.default.yml @@ -5,10 +5,10 @@ dependencies: config: - field.field.taxonomy_term.organization.field_default_image - field.field.taxonomy_term.organization.field_external_id - - image.style.3_2_m_2x + - responsive_image.styles.job_listing_org - taxonomy.vocabulary.organization module: - - image + - responsive_image - text _core: default_config_hash: Gz4Fau02tN8C3_Pjzxy-VS8VljtfEJNKjRK2Tfdh1Ag @@ -25,13 +25,13 @@ content: weight: 0 region: content field_default_image: - type: image + type: responsive_image label: above settings: + responsive_image_style: job_listing_org image_link: '' - image_style: 3_2_m_2x image_loading: - attribute: lazy + attribute: eager third_party_settings: { } weight: 1 region: content From 43029c9d03a6aeb40e2d79ef9c53bde3cfca11af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 30 Aug 2024 10:05:58 +0300 Subject: [PATCH 3/3] Fixed double quotes. --- public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index efe7e29f..a861fee9 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -86,8 +86,8 @@ function hdbt_subtheme_preprocess_organization_information_block(array &$variabl } // Set organization default image variable. - if (!empty($organization) && !empty($organization->get("field_default_image")->first())) { - $variables['content']['organization_default_image'] = $organization->get("field_default_image")->first()->view([ + if (!empty($organization) && !empty($organization->get('field_default_image')->first())) { + $variables['content']['organization_default_image'] = $organization->get('field_default_image')->first()->view([ 'type' => 'responsive_image', 'label' => 'hidden', 'settings' => [