News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product Image alignment

Started by ahtaylor1, November 15, 2013, 15:31:37 PM

Previous topic - Next topic

ahtaylor1

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

jenkinhill

#1
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?
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

ahtaylor1

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

ahtaylor1

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?

jenkinhill

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/
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

ahtaylor1

#5
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!