News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3 Using Different Size Thumbnails on different Pages (Examples)

Started by PRO, December 18, 2018, 00:58:58 AM

Previous topic - Next topic

PRO

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