Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / adjusting column width in main page new/featured products

adjusting column width in main page new/featured products

Locked

Views: 4,417

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
11 Jun 2008, 12:20 AM
#1
likes2draw avatar

likes2draw

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

adjusting column width in main page new/featured products

In the 'featured products' table on my home page, I made a few changes -- switched to left float, and added a tiny bit of padding between items. As a result, in a three column display, only two columns show. On a two column display, just one. The rightmost column items get bumped off. I think the problem is that the column widths are set to 33%. I can't figure out where or how to change them to about 28-30%. If this isn't clear, check out my store at surpiegirl.com/zencart. Thanks!!

11 Jun 2008, 1:16 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: adjusting column width in main page new/featured products

For Featured and others that you may or may not require you will have to edit one or more files: I have indicated a -1 but you may change to -2
This dynamically changes the width calculated minus the value you insert to allow for your padding

As always - make changes to a copy placed in an override folder named for your template

Go to …includes/modules/featured_products.php

$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);

to

$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS)-1;

Go to …includes/modules/specials_index

Then find..

$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);

Change to …

$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS) - 1;

Go to …includes/modules/category_row.php

$col_width = floor(100/$num_categories);

to

$col_width = floor(100/$num_categories)-1;
12 Jun 2008, 8:36 PM
#3
likes2draw avatar

likes2draw

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: adjusting column width in main page new/featured products

Beautiful!! I don't even need to add padding now. Changing the column width makes all the difference. Thank you!

18 Jun 2008, 4:28 PM
#4
chrisk avatar

chrisk

New Zenner

Join Date:
Feb 2007
Location:
London UK
Posts:
14
Plugin Contributions:
0

Re: adjusting column width in main page new/featured products

This fixed my problem and I was able to use a value of -0.1. for minimal disruption to the spacing of my page.

Thanks!