Skip to content

Commit

Permalink
Merge pull request #530 from City-of-Helsinki/UHF-10191
Browse files Browse the repository at this point in the history
UHF-10191: Image style refactor
  • Loading branch information
teroelonen authored Aug 30, 2024
2 parents 3c06a28 + d0e736f commit 4b406a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
10 changes: 3 additions & 7 deletions conf/cmi/core.entity_view_display.node.job_listing.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
],
]);
}
Expand Down

0 comments on commit 4b406a9

Please sign in to comment.