diff options
| -rw-r--r-- | views/produktseite/produkt.phtml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/views/produktseite/produkt.phtml b/views/produktseite/produkt.phtml index 0703462..313bac7 100644 --- a/views/produktseite/produkt.phtml +++ b/views/produktseite/produkt.phtml @@ -77,7 +77,8 @@ <meta itemprop="image" content="<?php echo esc_url((string)($att[0]??'')); ?>" /> <a class="wpsg-product__image" <?php if ($attachment_id != $arAttachmentID) echo 'style="display:none;"'; ?> rel="gallery-wpsg-<?php echo $this->getTemplateIndex(); ?>" title="<?php echo esc_attr($oProduct->getProductName()); ?>" href="<?php echo esc_url((string)($att[0]??'')); ?>" data-fslightbox="<?php echo $this->getTemplateIndex(); ?>" data-wpsg-image="<?php echo intval($i); ?>"> - <?php echo wp_get_attachment_image($attachment_id, 'large', false, ['sizes' => '(min-width: 800px) 50vw, 100vw']); ?> + <?php /* Sichtbares Bild des Hauptprodukts sofort und zuerst laden, verborgene erst beim Zeigen (W6) */ $bShown = ($attachment_id == $arAttachmentID); ?> + <?php echo wp_get_attachment_image($attachment_id, 'large', false, ['sizes' => '(min-width: 800px) 50vw, 100vw', 'loading' => (($bShown && $bMainProduct)?false:'lazy'), 'fetchpriority' => (($bShown && $bMainProduct)?'high':'auto')]); ?> </a> <?php } ?> @@ -87,7 +88,7 @@ <?php if ($nImages > 1) { ?> <ul class="wpsg-product__thumbs"> <?php foreach ($arAttachmentIDsAll as $i => $attachment_id) { ?> - <li><button type="button" class="wpsg-product__thumb" data-wpsg-image="<?php echo intval($i); ?>" aria-pressed="<?php echo (($attachment_id == $arAttachmentID)?'true':'false'); ?>" aria-label="<?php /* translators: 1: Nummer des Bildes, 2: Anzahl */ echo esc_attr(sprintf(__('Bild %1$d von %2$d anzeigen', 'wpsg'), $i + 1, $nImages)); ?>"><?php echo wp_get_attachment_image($attachment_id, 'thumbnail', false, ['alt' => '']); ?></button></li> + <li><button type="button" class="wpsg-product__thumb" data-wpsg-image="<?php echo intval($i); ?>" aria-pressed="<?php echo (($attachment_id == $arAttachmentID)?'true':'false'); ?>" aria-label="<?php /* translators: 1: Nummer des Bildes, 2: Anzahl */ echo esc_attr(sprintf(__('Bild %1$d von %2$d anzeigen', 'wpsg'), $i + 1, $nImages)); ?>"><?php echo wp_get_attachment_image($attachment_id, 'medium', false, ['alt' => '', 'sizes' => '(min-width: 800px) 8rem, 25vw', 'loading' => false]); ?></button></li> <?php } ?> </ul> <?php } ?> |
