How to use fotorama in my custom widget?
-
15-04-2021 - |
Question
I want to display my product image gallery in my custom widget.
$images = $_item->getMediaGalleryImages();
is how I got my images for product.
I want to display the image using fotorama? is this possible, how can I do it?
Solution
So I finally figured it out:
Found this link Magento 2 + need to use fotorama in cms page
Load it to custom template phtml file
<?php echo $block->getLayout()
->createBlock('Magento\Framework\View\Element\Template')
->setTemplate('Magento_Theme::fotorama_slider.phtml')
->toHtml();
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange