[Skip to main content](#vessel-content)

#   images on product page

##

- **[highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")**
- [![highstat@highstat.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile") Topic Author
- [ Offline](/forum/user/70596-highstat-highstat-com)

Less More

- Posts: 28
- Thank you received: 1
-
-

6 months 4 days ago [\#372050](#372050) by [highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")  *[images on product page](/forum/26-product-category-display/910547-images-on-product-page#372050 "-- HikaShop version -- : latest -- Joomla version -- : 6.5.0  Hello,  The default product page in hikashop is a hero picture (large one) with thumbnails of other pictures beside/below. Is it possible in hikashop to have 4 hero pictures on a 2x2 grid?  Or do I have to use a YOOtheme template for this?  Kind regards, Alain")* was created by *[highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")*

-- HikaShop version -- : latest
-- Joomla version -- : 6.5.0

Hello,

The default product page in hikashop is a hero picture (large one) with thumbnails of other pictures beside/below. Is it possible in hikashop to have 4 hero pictures on a 2x2 grid?

Or do I have to use a YOOtheme template for this?

Kind regards,
Alain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTA1NDctaW1hZ2VzLW9uLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14327
-
-

6 months 3 days ago [\#372054](#372054) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[images on product page](/forum/26-product-category-display/910547-images-on-product-page#372054 "-- HikaShop version -- : latest -- Joomla version -- : 6.5.0  Hello,  The default product page in hikashop is a hero picture (large one) with thumbnails of other pictures beside/below. Is it possible in hikashop to have 4 hero pictures on a 2x2 grid?  Or do I have to use a YOOtheme template for this?  Kind regards, Alain")*

Hello Alain,

There is no built-in option for a 2x2 grid of large images: the default product image block is one main image with thumbnails next to it. You do not need a YOOtheme template for this, a small HikaShop view override of show_block_img.php is enough.

Do it as an override so a HikaShop update will not overwrite it: in the back end, go to Display &gt; Views, find the "product / show_block_img" view and edit it there (this is the update-safe way); or place the file at templates/YOUR_TEMPLATE/html/com_hikashop/product/show_block_img.php.

Here is a version that shows the first four product images in a 2x2 grid (it replaces the usual main-image-plus-thumbnails markup):
Code:

&lt;?php // Show the first 4 product images as a 2x2 grid. $images = !empty($this-&gt;element-&gt;images) ? array_slice($this-&gt;element-&gt;images, 0, 4) : array(); $height = (int)$this-&gt;config-&gt;get('product_image_y'); $width = (int)$this-&gt;config-&gt;get('product_image_x'); if(empty($height)) $height = (int)$this-&gt;config-&gt;get('thumbnail_y'); if(empty($width)) $width = (int)$this-&gt;config-&gt;get('thumbnail_x'); $opts = array('default' =&gt; true, 'forcesize' =&gt; $this-&gt;config-&gt;get('image_force_size', true), 'scale' =&gt; $this-&gt;config-&gt;get('image_scale_mode', 'inside')); ?&gt; &lt;div id="hikashop_product_image_main" class="hikashop_global_image_div hikashop_img_grid"&gt; &lt;?php foreach($images as $image) { echo '&lt;div class="hikashop_img_grid_cell"&gt;'; if($this-&gt;image-&gt;override) { echo $this-&gt;image-&gt;display(@$image-&gt;file_path, true, @$image-&gt;file_name, '', '', $width, $height); } else { $img = $this-&gt;image-&gt;getThumbnail(@$image-&gt;file_path, array('width' =&gt; $width, 'height' =&gt; $height), $opts); if(@$img-&gt;success) { echo '&lt;img src="'.$img-&gt;url.'" alt="'.$this-&gt;escape((string)@$image-&gt;file_name).'" title="'.$this-&gt;escape((string)@$image-&gt;file_description).'" /&gt;'; } } echo '&lt;/div&gt;'; } ?&gt; &lt;/div&gt; &lt;style&gt; .hikashop_img_grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; max-width:&lt;?php echo (2*$width)+10; ?&gt;px; margin:auto; } .hikashop_img_grid_cell img { width:100%; height:auto; display:block; } @media (max-width:480px){ .hikashop_img_grid{ grid-template-columns:1fr; } } &lt;/style&gt;

A few notes:
- It uses your configured product image dimensions, so the four images are rendered at the large/hero size, not the small thumbnail size.
- It shows the first four images of the product (fewer if the product has fewer); images beyond the first four are not shown with this layout.
- The grid drops to a single column on small screens; adjust the gap and max-width in the small style block to taste.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTA1NDctaW1hZ2VzLW9uLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")**
- [![highstat@highstat.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile") Topic Author
- [ Offline](/forum/user/70596-highstat-highstat-com)

Less More

- Posts: 28
- Thank you received: 1
-
-

6 months 3 days ago [\#372062](#372062) by [highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")  Replied by *[highstat@highstat.com](/forum/user/70596-highstat-highstat-com "View highstat@highstat.com's Profile")* on topic *[images on product page](/forum/26-product-category-display/910547-images-on-product-page#372062 "-- HikaShop version -- : latest -- Joomla version -- : 6.5.0  Hello,  The default product page in hikashop is a hero picture (large one) with thumbnails of other pictures beside/below. Is it possible in hikashop to have 4 hero pictures on a 2x2 grid?  Or do I have to use a YOOtheme template for this?  Kind regards, Alain")*

Thank you. I will try that!

Kind regards,
Alain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTA1NDctaW1hZ2VzLW9uLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.048 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
