Skip to content

Commit

Permalink
EWPP-4396: Use higher resolution image style for Media paragraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Jun 14, 2024
1 parent e4f7d8f commit 8e30eca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oe_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ function oe_theme_preprocess_paragraph__oe_av_media(array &$variables): void {
// If it's an image media, render it and assign it to the image variable.
if ($source instanceof MediaAvPortalPhotoSource || $source instanceof Image) {
$thumbnail = $media->get('thumbnail')->first();
$variables['image'] = ImageValueObject::fromStyledImageItem($thumbnail, 'oe_theme_medium_no_crop');
$variables['image'] = ImageValueObject::fromStyledImageItem($thumbnail, 'oe_theme_medium_2x_no_crop');
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/src/Kernel/Paragraphs/MediaParagraphsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ public function testMediaParagraph(): void {
$this->assertCount(1, $crawler->filter('figure.ecl-media-container__figure img.ecl-media-container__media'));
$image_element = $crawler->filter('figure.ecl-media-container__figure img.ecl-media-container__media');
$this->assertStringContainsString('example_1_en.jpeg', $image_element->attr('src'));
$this->assertStringContainsString('oe_theme_medium_2x_no_crop', $image_element->attr('src'));

// Assert bulgarian rendering.
$html = $this->renderParagraph($paragraph, 'bg');
Expand Down

0 comments on commit 8e30eca

Please sign in to comment.