News:

Support the VirtueMart project and become a member

Main Menu

How to display a picture using function displayImage in Virutmart

Started by trifanfan, November 16, 2014, 12:50:21 PM

Previous topic - Next topic

trifanfan

I am trying to display an image on a Joomla2.5+Virtumart2 site. I know only the virtuemart_media_id of this pic and found that function online displayImage($virtuemart_media_id,$key) but struggle to display the pics.

Here is my code. I have controlled that $this->category->virtuemart_media_id contains at least one value.

if ($this->category->virtuemart_media_id) {
    foreach ($this->category->virtuemart_media_id as $catimg) {
        echo $catimg->displayImage("");
    }
}

I do not understand what's the $key for. Here the code of the function: http://docs.virtuemart.net/api-vm2/db/d4c/mediahandler_8php_source.html#l01012

GJC Web Design

what view are u trying to do this in?

IMHO displayImage() is only for the admin - it needs an image object and it returns hidden form elements as well

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