1

I am trying to add images product gallery to my custom widget using Fotorama. What it should look like: enter image description here

So I tried to initialize the gallery widget using the js script. Based on the info I got from https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_gallery.html. But for some reason, it is not displaying correctly. Am I missing something here?

This is how it looks like: (It is display 3 images all at once instead just one image) enter image description here

Any idea on how can I fix this? Thanks

asked Nov 5, 2020 at 4:28

1 Answer 1

2

So I figured it out after days of trying to fix this. The problem is because there is a css file that is not loaded properly.

<link rel="stylesheet" type="text/css" href="<?php echo $block->getViewFileUrl('mage/gallery/gallery.css')?>">

Adding the above code to my custom phtml fixed the issue.

answered Nov 5, 2020 at 18:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.