VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: trifanfan on November 16, 2014, 12:50:21 PM

Title: How to display a picture using function displayImage in Virutmart
Post by: trifanfan on November 16, 2014, 12:50:21 PM
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
Title: Re: How to display a picture using function displayImage in Virutmart
Post by: GJC Web Design on November 16, 2014, 13:03:28 PM
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