Forums / Templates, Stylesheets, Page Layout / Chage the display of Categories List Page

Chage the display of Categories List Page

Locked

Started by coolcarpartsonline on 2 Apr 2009, 3:19 AM · Views: 1,898

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
2 Apr 2009, 3:19 AM
#1
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Chage the display of Categories List Page

I have done changes to the layout of the Zen Cart Pages. I managed to do the changes to all the pages except on page. The categories list page found here: http://www.ohiospeedshop.com/dev/acura-c-132_134.html I changed the tpl_column_display to list the content of the center column at 33% width, it works on the product list page, the categories in the home page but for some reason the categories list is not working propely when I only have 2 categories. It seems to work when I have more than 3 categories.

Does anyone know if there is something setting that normal Zen cart view when there is less than 2 or less categories?

2 Apr 2009, 6:40 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Chage the display of Categories List Page

/includes/modules/your_template/category_row.php automatically spaces the categories equally when there are fewer of them than the "categories per row" setting.

if ($num_categories > 0) {
  if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) {
    $col_width = floor(100/$num_categories);
  } else {
    $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);
  }
2 Apr 2009, 12:56 PM
#3
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Chage the display of Categories List Page

Is there a way to make it display the categories when there are only 2 or 1 category in the same layout as if there was 3 or more categories or product?

3 Apr 2009, 10:42 AM
#4
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Chage the display of Categories List Page

I think I was able to fix that, I changed the style=width:187px so it display the content of each product list at a set width in my case 187px. time to play with myphpadmin now. :clap:

3 Apr 2009, 7:41 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Chage the display of Categories List Page

Or you can just replace

$col_width = floor(100/$num_categories);

with

$col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);

to keep the built-in flexibility.