-
Couldn't load subscription status.
- Fork 9.4k
Catalog image lazy load #27033
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
Catalog image lazy load #27033
Changes from 5 commits
c00cef4
1a79775
182a474
0bd7a87
56fde6c
463c460
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,16 +4,20 @@ | |
| * See COPYING.txt for license details. | ||
| */ | ||
| ?> | ||
| <?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?> | ||
| <?php | ||
| /** @var $block \Magento\Catalog\Block\Product\Image */ | ||
| /** @var $escaper \Magento\Framework\Escaper */ | ||
| ?> | ||
|
|
||
| <span class="product-image-container" | ||
| style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;"> | ||
| style="width:<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>px;"> | ||
| <span class="product-image-wrapper" | ||
| style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;"> | ||
| <img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>" | ||
| <?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?> | ||
| src="<?= $block->escapeUrl($block->getImageUrl()) ?>" | ||
| max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>" | ||
| max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>" | ||
| alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span> | ||
| <img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>" | ||
| <?= $escaper->escapeHtmlAttr($block->getCustomAttributes()) ?> | ||
| src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>" | ||
| loading="lazy" | ||
| width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>" | ||
|
||
| height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>" | ||
| alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span> | ||
tdgroot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </span> | ||
Uh oh!
There was an error while loading. Please reload this page.