Author Topic: VM3 Using Different Size Thumbnails on different Pages (Examples)  (Read 1407 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
You have the ability to use different size thumbnails for different views.
For Example,
Category Page
Product Page (Additional Images)
Virtuemart Product Module

Requirements
Backend Settings
Dynamic Thumbnail Resizing must be enabled.

Backend Thumbnail Size Settings.
You set EITHER the height, or the width to the standard thumbnail size you want.

Then, In your frontend template OVERRIDE
In the code examples below the 0,150  is the width,height . You may reverse the numbers to give a max width and auto height like so 150,0. This can be useful depending on the space you have in template.
So if you want to have a max thumbnail height of 50px, you just change the 0,150 to 0,50


For category product list page. (sublayouts/products.php)


Additional Images (productdetails/default_images_additional.php)
$image->displayMediaThumb('class="product-image" style="cursor: pointer" data-descr="'.$image->file_description.'"',false,'',true,$descr,false,150,0);


Mod Virtuemart Product
$product->images[0]->displayMediaThumb('class="product-image"',false,'',true,false,false,0,150);

More Information
https://docs.virtuemart.net/tutorials/templating-layouts/222-different-thumbnail-sizes.html
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)