Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-4396: Use higher resolution image style for Media paragraph. #1466

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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