Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Strange spaces in categories sidebox

Strange spaces in categories sidebox

Locked

Views: 1,049

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
6 Jun 2007, 9:30 PM
#1
staedtler avatar

staedtler

New Zenner

Join Date:
Jun 2007
Posts:
18
Plugin Contributions:
0

Strange spaces in categories sidebox

Anyone know how I can get rid of the spaces that are appearing under each of the categories links and still allow each link to span the entire width and recognize the padding I apply?

I tried putting width to 100%, 178px and auto on the actual links, the containing div and none of those worked. I then added display: block; to the A.category-top class and it spans the full width and recognizes padding but it adds that annoying space.

I was thinking it might be the product count (which I turned off in the admin area). Is it possible to remove this from the code with screwing everything up?

http://img505.imageshack.us/img505/8954/storefrontmf8.gif

The yellow color is to show the space issue better

6 Jun 2007, 9:48 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Strange spaces in categories sidebox

Can you give an actual link to your site?

It does sound like there might be an extra space outside the link that is being wrapped down... although it looks like the last category in the list is not getting an extra space, but just the normal inter-box spacing.

6 Jun 2007, 10:22 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Strange spaces in categories sidebox

I just replicated this on my own site.

The display: block; has an implied break, so the <br /> at the end of every line adds another one. To remove that, find this section in /includes/templates/your_template/sideboxes/tpl_categories.php ```php
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}

  $content .= '<br />' . "\n";
}

}

if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
// display a separator between categories and links

and remove the '<br />' . from
 $content .= '<br />' . "\n";
leaving
 $content .= "\n";

As long as cats are block (or too long for two to fit on one line) you will be fine.
6 Jun 2007, 10:27 PM
#5
staedtler avatar

staedtler

New Zenner

Join Date:
Jun 2007
Posts:
18
Plugin Contributions:
0

Re: Strange spaces in categories sidebox

You Sir, are awesome... and I thank you.

If you're up to it, how would I need to alter the code in tpl_whats_new.php to get the picture to go below the text and price?

Again thanks for you help