News:

Looking for documentation? Take a look on our wiki

Main Menu

All the images appear in full size

Started by sirius, February 03, 2012, 12:11:20 PM

Previous topic - Next topic

sirius

Hi
sorry if this is not the good place to post (I can make a new topic if you wish)

But this is also images related.

Ok for me too I set all images to "pulished" state in the media.

But now on the product detail view, all the images appear in full size, because now the "Main image" is call as:
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"',false,"class='modal'",true); ?>

But there's no css class for "medium-image" so, I changed it to:
<?php echo $this->product->images[0]->displayMediaFull('class="product-image" id="medium-image"',false,"class='modal'",true); ?>

Just to make the tweak, also I notice that the modal doesn't work too, strange because it works for the additional images.

So it's probably something to change in the "displayMediaFull" function, related to the difference between "displayMediaFull" and "displayMediaThumb"

Thanks for advice on this
J3.10.12 | PHP 7.4.33 + APC + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777

mangotti

Is this the corrective fix? Also, what file did you make these changes in?

jenkinhill

Wrong way; if you need the main product image a certain size you add a descriptor for medium-image into the VM css file, vmsite-ltr.css or append it to your Joomla template css file.

eg.
        .medium-image {
            width:350px;
        }
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

mangotti

jenkinhill, Thank you. That worked great

552288

Quote from: mangotti on February 26, 2012, 15:08:58 PM
jenkinhill, Thank you. That worked great

Thank you too jenkinhill, i tried 2 hours and found no solution for this Problem after update from 2.0 to 2.02

Give me five!

Greetz Ray

cvoogt

CSS is an OK short-term solution but it makes the images slow to load if they're several Mb in size, which they very well can be if customers upload them.
The function (displayMediaFull) in /administrator/components/com_virtuemart/helpers/image.php looks OK to me. I think the issue may be that when the image is uploaded in VM's admin interface, it does not resize it or generate a smaller version... as if it is not using GD Image ..

Now, my Joomla file system is set to use FTP so maybe there is a problem there. My directories / file ownership are set funny so maybe it tried to resize but couldn't write in a certain location.
Not sure what's going on

elroy2k

What if you don' know how to

"add a descriptor for the class medium-image into the VM css file"

:(

Scylla

#7
Quote from: elroy2k on April 20, 2012, 18:53:52 PM
What if you don' know how to

"add a descriptor for the class medium-image into the VM css file"

:(
take a look into the directory <Joomla directory>/components/com_virtuemart/assets/css
There you can find the "vmsite-ltr.css". Open it and paste the following at the bottom of the file:
.medium-image {
            width:350px;
        }

But remember: This will be overwritten if you update your VM Component.
A better way is to add the Code somewhere into your template css (e.g. <Joomla directory>/templates/beez_20/css/personal.css if you are using the Beez_20 Template)

By the way: .medium-image { width:100%;} works as well if you are using the default product view.

ricewing

Geeez guys, why do we have to edit these files, how hard is it to add a setting in the configuration sections of the program?