Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Display of New Products on main page - want 3 columns

Display of New Products on main page - want 3 columns

Locked

Started by elainedutton on 31 Mar 2008, 10:41 AM · Views: 4,073

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
31 Mar 2008, 10:41 AM
#1
elainedutton avatar

elainedutton

New Zenner

Join Date:
Mar 2008
Location:
London
Posts:
9
Plugin Contributions:
0

Post #1 by elainedutton

Hi there,

The new products (called new arrivals) on my main page are displaying strangely. I have 3 on one line, one of the next, and then two below. I thought I had set it to show 3 in a line, why won't it display two neat rows of 3?

If anyone has any advice it would be most welcome! https://www.puredesigncompany.co.uk/shop

thanks, Elaine

6 Apr 2008, 3:56 AM
#2
jbensous avatar

jbensous

New Zenner

Join Date:
Apr 2008
Posts:
6
Plugin Contributions:
0

Post #2 by jbensous

I have the exact same problem...I have looked everywhere to figure out why it won't display right, but no luck...very frustrated. I have also tried all the suggestions i have seen here - changing widths, the css file, etc.

http://potteryreserve.com/

6 Apr 2008, 5:37 AM
#3
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #3 by clydejones

elainedutton:

Hi there,

The new products (called new arrivals) on my main page are displaying strangely. I have 3 on one line, one of the next, and then two below. I thought I had set it to show 3 in a line, why won't it display two neat rows of 3?

If anyone has any advice it would be most welcome! https://www.puredesigncompany.co.uk/shop

thanks, Elaine

try adding this to: includes/templates/custom/css/stylesheet.css

.centerBoxContentsNew {padding: 5px 0;}

jbensous:

I have the exact same problem...I have looked everywhere to figure out why it won't display right, but no luck...very frustrated. I have also tried all the suggestions i have seen here - changing widths, the css file, etc.

http://potteryreserve.com/

try adding this to: includes/templates/classic/css/stylesheet.css

.centerBoxContentsNew {padding: 5px 0;}

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Apr 2008, 3:39 PM
#4
jbensous avatar

jbensous

New Zenner

Join Date:
Apr 2008
Posts:
6
Plugin Contributions:
0

Post #4 by jbensous

I tried adding that but it had no effect. I think I actually need to change this code:

<div class="centerBoxContentsNew centeredContent back" style="width: 33%;">

Problem is, I have searched through the development tools and can find the code nowhere...where would I change the percentage from 33% to 25%? Thanks!!!

6 Apr 2008, 8:31 PM
#5
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #5 by clydejones

jbensous:

I tried adding that but it had no effect. I think I actually need to change this code:

<div class="centerBoxContentsNew centeredContent back" style="width: 33%;">

Problem is, I have searched through the development tools and can find the code nowhere...where would I change the percentage from 33% to 25%? Thanks!!!

Some of your images are 67px high and some are 80px high.

because of this some of the images aren't giving others enough space (height wise) and they are being squeezed to the next line.

adding padding (.centerBoxContentsNew {padding: 5px 0;} helps adjust the height and should assist with lining up the images properly.

Try adding this:
.centerBoxContentsNew {padding: 0 0 5px 0;}

adjust the highlighted portion (which is the bottom padding) from 5px to 10px or 15px and see if that helps.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Apr 2008, 10:13 PM
#6
jbensous avatar

jbensous

New Zenner

Join Date:
Apr 2008
Posts:
6
Plugin Contributions:
0

Post #6 by jbensous

I tried doing that and it had no effect (am up to 20). I am not sure it is the height of the image so much as it the width of the space allotted for the module :: centerBoxContentsNew centeredContent back" style="width: 33%;"

The width of each column seems to be what is pushing the third column to the bottom, not the height of the image. Can someone please tell me where to find that code above so I can try and alter that to see if it is the problem? Thanks!

6 Apr 2008, 10:53 PM
#7
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #7 by clydejones

jbensous:

I tried doing that and it had no effect (am up to 20). I am not sure it is the height of the image so much as it the width of the space allotted for the module :: centerBoxContentsNew centeredContent back" style="width: 33%;"

The width of each column seems to be what is pushing the third column to the bottom, not the height of the image. Can someone please tell me where to find that code above so I can try and alter that to see if it is the problem? Thanks!

The division of the column width is handled automatically by Zen Cart. It takes the width overall width of the display area (assumed to be 100%) and divides each row in the number of columns you have specified to be shown.

in your case I guessing you've selected 3 columns to be shown per row. So zen cart has set the column width to 33% (int(100/3) = 33%) if you want to try 4 columns per row that would set the width to 25%.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

7 Apr 2008, 12:42 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #8 by gjh42

It is the width that is doing it. I haven't yet found anything that should cause it in your case, but adding either of these to your stylesheet (not both) will fix it:

.centerBoxContentsNew {margin: 0 -5px;}

or

.centerBoxContentsNew {width: 30% !important;}

The !important is often a copout to avoid fixing a problem, and I would tend not to use it.

7 Apr 2008, 12:50 AM
#9
jbensous avatar

jbensous

New Zenner

Join Date:
Apr 2008
Posts:
6
Plugin Contributions:
0

Post #9 by jbensous

I tried changing the columns to 4 and then 5 - it did not change the percentage. It is apparently hard-coded somewhere...this is turning into a real nightmare.

7 Apr 2008, 12:55 AM
#10
jbensous avatar

jbensous

New Zenner

Join Date:
Apr 2008
Posts:
6
Plugin Contributions:
0

Post #10 by jbensous

gjh42:

It is the width that is doing it. I haven't yet found anything that should cause it in your case, but adding either of these to your stylesheet (not both) will fix it:

.centerBoxContentsNew {margin: 0 -5px;}

or

.centerBoxContentsNew {width: 30% !important;}

The !important is often a copout to avoid fixing a problem, and I would tend not to use it.

Yes! It is fixed - THANK YOU! I used the .centerBoxContentsNew {margin: 0 -5px;} to resolve the problem. Thanks to everyone that has tried to help. I really appreciate it. :smile:

7 Apr 2008, 1:00 AM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #11 by ajeh

Just a note ... the images on your site are monsters ... :eek:

You really want to get those down to 1k to 10k vs 500k+ on those small images ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Apr 2008, 11:09 AM
#12
elainedutton avatar

elainedutton

New Zenner

Join Date:
Mar 2008
Location:
London
Posts:
9
Plugin Contributions:
0

Post #12 by elainedutton

Thanks for everyone's advice. Unfortunately the padding and margin inserts didn't work for my website. They moved the sideboxes on the left down the page, (which i didn't want), and had no affect on the display of images under new products.:dontgetit

Any other ideas?

thanks, Elaine

8 Apr 2008, 7:47 PM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #13 by gjh42

None of the CSS suggestions in this thread could affect the sideboxes in any way.

For some reason, your center column is more crowded than jbensous'. Increasing the negative margin to -10px works:

.centerBoxContentsNew {margin: 0 -10px;}

I also notice that you have tried to position your logo with
#logo {float: center;
}
This can't work; there is no such value for float as "center". Use
text-align: center;
for this.

8 Apr 2008, 9:28 PM
#14
elainedutton avatar

elainedutton

New Zenner

Join Date:
Mar 2008
Location:
London
Posts:
9
Plugin Contributions:
0

Post #14 by elainedutton

I tried the -10px insert but it still moved the sideboxes down the page (on left hand side) and didn't make any difference to the display of the new products. I'm sorry - I'm not sure why it doesn't seem to be working. Any other ideas?

thanks, Elaine

8 Apr 2008, 9:39 PM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #15 by gjh42

You must be inserting it in the wrong place. Find in your stylesheet```
/list box contents/
.centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew {
margin: 1em 0em;
}


.centerBoxContentsNew {margin: 0 -10px;}

just below that. The existing margin property will cancel the new one if it comes after the new one in the file.
For good practice, delete 
, .centerBoxContentsNew
from the existing declaration so it is not defined twice.
9 Apr 2008, 8:00 PM
#16
elainedutton avatar

elainedutton

New Zenner

Join Date:
Mar 2008
Location:
London
Posts:
9
Plugin Contributions:
0

Post #16 by elainedutton

Hooray! It worked. :clap:thank you. I was obviously putting it in the wrong place.

Thank you for your advice and support! Elaine