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?

Was it helpful?

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
scroll top