VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ahtaylor1 on November 15, 2013, 15:31:37 PM

Title: Product Image alignment
Post by: ahtaylor1 on November 15, 2013, 15:31:37 PM
Joomla - 2.5.14
Virtuemart - 2.0.18

Hi Guys,

I want to centre the product image within some modules (Featured Products etc).  I have used Firebug to look at the css but can seem to see where the alignment would be set.  Any ideas?

Thanks
Title: Re: Product Image alignment
Post by: jenkinhill on November 15, 2013, 16:23:40 PM
Images are centered in the current (2.0.24a) default VM modules:

in vmsite-ltr.css  >>>
.main-image, .featured-view .product, .latest-view .product, .topten-view .product, .recent-view .product, .related-products-view .product, .center, span.center {
    text-align: center;
}

.main-image img.product-image, .featured-view .spacer img, .latest-view .spacer img, .topten-view .spacer img, .recent-view .spacer img {
    height: auto;
    max-width: 100%;
    width: auto;
}

If this is not so for you then maybe you are using  a commercial template with overrides?
Title: Re: Product Image alignment
Post by: ahtaylor1 on November 15, 2013, 17:32:59 PM
It is not a commercial template so not sure why it is not centred within the module box.  It is definitely left alignment.  Will check the code to make sure.

Thanks
Title: Re: Product Image alignment
Post by: ahtaylor1 on November 18, 2013, 11:36:22 AM
I have checked the code which does show "centred"  not sure why my product and its title are displaying to the left of the module box.  You mentioned overrides - could I check these and change back to "centre" if indeed they have used an override?
Title: Re: Product Image alignment
Post by: jenkinhill on November 18, 2013, 12:47:24 PM
You can certainly edit overrides, just make sure you keep a copy of the original. If used they will be in [yourjoomlatemplate]/html/com_virtuemart/modules/
Title: Re: Product Image alignment
Post by: ahtaylor1 on November 19, 2013, 12:33:29 PM
Hi Jenkinhill

I have checked the directory path which you gave.  I have checked the html folder in my template folder and there are only three folders

com_contact
com_content
mod_search

I do not have a com_virtuemart folder. 

Although some of my edits to the CSS are affecting the product images they do not actually center the image and its title within the module box.

Think I may have to give up on this one as I am at a complete loss as to how to change the code.

After a bit more tinkering I have now managed to centre the products and their descriptions in my "Featured Products" Module box - not sure how but it is working.  Only slight problem is that it displays the products centred on some of my pages and left on other pages!!!  Not sure how that one works!

Title: Re: Product Image alignment
Post by: Maxim Pishnyak on November 22, 2013, 22:25:41 PM
Check how things work with this
http://forum.virtuemart.net/index.php?topic=95272.0
http://forum.virtuemart.net/index.php?topic=102850.0