News:

Support the VirtueMart project and become a member

Main Menu

Different images for sublayout thumbnail and product details

Started by ripple, May 08, 2021, 11:37:24 AM

Previous topic - Next topic

ripple

My products have two images and I'd like to use them in the following way:

  • cropped closeup used as a thumbnail in the browse view
  • main image of the product in the product details view
How can I define the first image to be used as a thumbnail in the browse view only, and show only the other main image on the product details page?

EDIT: Note, this may be an issue with the new admin template! I had been trying to enter the /resized/ thumbnail URL into the 'Used thumb url' field, but was never able to get it to save. Each time I tried, the field went blank again. I assumed it was a locked VM setting. BUT, when I changed back to the old admin template, viola! my entry into the 'Used thumb url' field saved. My images are operating as I had hoped. However, shouldn't some VM guru be notified of this template bug?

TIA  :)

ermes

You see that it could easily be a template problem: net of the backend configurations, you can decide in any view (component and modules) the size of the thumbs to be generated as follows:

$image->displayMediaThumb("",true,"", true, true, false, $width, $height);

Where $image is an istance of VmMediaHandler. All images loaded in product via addImages (Es.: $product_model->addImages($product);) are istance of this class. So in any override file of your template you can specify width and height.
This is the best use of it. Very simple and very dynamic.
Following the parameters:

   - @param string $imageArgs Attributes to be included in the <img> tag.
   - @param boolean $lightbox alternative display method
   - @param string $effect alternative lightbox display
   - @param boolean $withDesc display the image media description
   - @param boolean $absUrl use the absolute url
   - @param int $width image width of new thumb
   - @param int $height image height of new thumb

GJC Web Design

Quotecropped closeup used as a thumbnail in the browse view

note that the browse view only loads the first image as standard... so the close cropped would need to be the 1st image

then in the details just loop thru the 2 images and only display the second
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation