Hello, Magento folks,

Last time we learned how you can create custom UI Component using knowckout.js in Magento 2.

Today, we are going to learn how you can change thumbnail in image gallery fotorama for any product page from horizontal to vertical.

Sometimes there are images that look better when their alignment is set as vertical rather than horizontal. You might want to change that, but you found no solution for that.

Well, we are here to solve the issue you are having. With the help of view.xml file for a gallery that is used by Magento, you can shift the view of your images from horizontal to vertical and vice-versa as you need.

Follow the instructions given below to set gallery fotorama thumbnail as a vertical view on the product view page.

Find a variable named navdir at given below path:


In this file, you can see a variable navdir search under <var name= “gallery”> tag.

You need to replace the below code:

With this code

You can define your own custom view in the same file at the given path.

You can also set your custom view on mobile devices as well. To do that you need to define the condition for mobile in the available breakpoint variable. Change the alignment of image thumbnail as vertical or horizontal by placing navdir variable, as shown below.

So, this was it. Using this you can set the thumbnail of fotorama gallery image as vertical. You can do this mobile too. If you have any problem while implementation, then contact our support team for help. We will be happy to help you. Lastly, if you like this article, then let us know in the comments below. Also, make sure that you share this with your Magento colleagues and friends.

Happy Reading!

Click to rate this post!
[Total: 15 Average: 4.9]