Skip to content

Commit ca3245f

Browse files
author
gwharton
committed
Revert "[2.2-develop] Update Gallery Template to handle boolean config Variables"
This reverts commit 8ef039e.
1 parent 8ef039e commit ca3245f

File tree

1 file changed

+30
-10
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view

1 file changed

+30
-10
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,21 @@
4747
"data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>,
4848
"options": {
4949
"nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>",
50-
"loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ? 'true' : 'false' ?>,
51-
"keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ? 'true' : 'false' ?>,
52-
"arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ? 'true' : 'false' ?>,
53-
"allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ? 'true' : 'false' ?>,
54-
"showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ? 'true' : 'false' ?>,
50+
<?php if (($block->getVar("gallery/loop"))): ?>
51+
"loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ?>,
52+
<?php endif; ?>
53+
<?php if (($block->getVar("gallery/keyboard"))): ?>
54+
"keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ?>,
55+
<?php endif; ?>
56+
<?php if (($block->getVar("gallery/arrows"))): ?>
57+
"arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ?>,
58+
<?php endif; ?>
59+
<?php if (($block->getVar("gallery/allowfullscreen"))): ?>
60+
"allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ?>,
61+
<?php endif; ?>
62+
<?php if (($block->getVar("gallery/caption"))): ?>
63+
"showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ?>,
64+
<?php endif; ?>
5565
"width": "<?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_medium', 'width') ?>",
5666
"thumbwidth": "<?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_small', 'width') ?>",
5767
<?php if ($block->getImageAttribute('product_page_image_small', 'height') || $block->getImageAttribute('product_page_image_small', 'width')): ?>
@@ -69,18 +79,28 @@
6979
"transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>,
7080
<?php endif; ?>
7181
"transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>",
72-
"navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ? 'true' : 'false' ?>,
82+
<?php if (($block->getVar("gallery/navarrows"))): ?>
83+
"navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ?>,
84+
<?php endif; ?>
7385
"navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>",
7486
"navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navdir") ?>"
7587
},
7688
"fullscreen": {
7789
"nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>",
78-
"loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ? 'true' : 'false' ?>,
90+
<?php if ($block->getVar("gallery/fullscreen/loop")): ?>
91+
"loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ?>,
92+
<?php endif; ?>
7993
"navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>",
80-
"navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ? 'true' : 'false' ?>,
94+
<?php if ($block->getVar("gallery/transition/navarrows")): ?>
95+
"navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ?>,
96+
<?php endif; ?>
8197
"navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>",
82-
"arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ? 'true' : 'false' ?>,
83-
"showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ? 'true' : 'false' ?>,
98+
<?php if ($block->getVar("gallery/fullscreen/arrows")): ?>
99+
"arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ?>,
100+
<?php endif; ?>
101+
<?php if ($block->getVar("gallery/fullscreen/caption")): ?>
102+
"showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ?>,
103+
<?php endif; ?>
84104
<?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?>
85105
"transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>,
86106
<?php endif; ?>

0 commit comments

Comments
 (0)