VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: dav3sh on October 04, 2015, 21:51:18 PM

Title: Add class to $thumb img in related.php file <<--SOLVED-->>
Post by: dav3sh on October 04, 2015, 21:51:18 PM
Hi,
How can I add a class to the $thumb variable directly to the img tag?
For what I had understood the piece of code that generates the img tag of the related products is located in related.php file.
Exactly this:

echo JHtml::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb   . $related->product_name, array('title' => $related->product_name,'target'=>'_blank'));

Now I would like to know how can I add a img-responsive class just to the img tag and not to the whole content of the link (img and title).
I am very grateful for this wonderful component to the developers and to the community of VM.
Thank you for any help.
Title: Re: Add class to $thumb img in related.php file
Post by: GJC Web Design on October 04, 2015, 22:15:11 PM
the image html is rendered right back in function  displayIt() in administrator\components\com_virtuemart\helpers\mediahandler.php

you can pass arguments to it so u need to trace back where you can add the class, view maybe?
Title: Re: Add class to $thumb img in related.php file
Post by: PRO on October 04, 2015, 22:42:56 PM
Quote from: dav3sh on October 04, 2015, 21:51:18 PM
I would like to know how can I add a img-responsive class just to the img tag



#DIV-NAME img{}
Title: Re: Add class to $thumb img in related.php file
Post by: dav3sh on October 05, 2015, 00:24:46 AM
Thank you for the answers..i am using the second one. I was hoping that I could have done it from the related.php file, because I already created an override of that.
In any case thank you again