Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Line Spacing in the Categories Box


azriel

Recommended Posts

Hi all,

 

I'm in the process of setting up a new site and was wanting to know if it is possible to increase the line spacing in the products (categories) box.

 

I would like just a little more space beteen each line item in this box to make it look a little less crowded. I've been able to increase the spacing at the top, bottom and sides of the box, but can not find how to do it for each line of text.

 

Has anyone done this, or know how to do it, or even if it can be done?

 

You assistance is appreciated.

 

Scott

Link to comment
Share on other sites

A simple way is to use a transparent gif.

 

Open up /includes/boxes/categories.php and find the line:

 

	$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

 

 

change it to:

 

 

	$tree[$categories['categories_id']] = array('name' => $categories['categories_name'] . tep_draw_separator('pixel_trans.gif', '1', '15'),

 

(the transparent gif above is already in your images directory)

 

Adjust the '15' to the spacing you require :)

 

 

Sonia

Link to comment
Share on other sites

There is also <br> tags in categories.php which can be changed to <p> to add a linespace quite easily.

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Link to comment
Share on other sites

Some further info from Sonia in regards to my questions! Code works great and site is doing what i want. Thanks again

 

:thumbsup:

__________

 

QUOTE

Hi Sonia,

 

Thanks heaps for your help with my line pacing question. I also figured out where to add the code you mentinoed to get line spacing between the subcategories.

 

Two questions if I might, and feel free to tell me to go away:

 

1. Is it possible to apply the spacing to all but the first line? I notice that the code you have given put the pixel_trans.gif at the end of the first line as well and it ends up padding the first line from the top of the box. i.e. the categories are no longer centered vertically in the box.

 

2. Do you know how to add a horizontal rule between each category?

 

Like i said, feel free to send me elsewhere but though I'd ask anyway.

 

Thanks a bunch

 

Scott

 

 

Forgot

 

To not space at the top you would need to remove the previous location of the image and do this:

 

  while ($categories = tep_db_fetch_array($categories_query))  {
  if ($row == 0) {
  $spacer = '';
 } else {
$spacer = tep_draw_separator('pixel_trans.gif', '1', '15');
 }
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'] . $spacer,
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
$row++;
 }

 

 

 

Sonia

Link to comment
Share on other sites

Some further info from Sonia in regards to my questions! Code works great and site is doing what i want. Thanks again

 

:thumbsup:

__________

 

QUOTE

Hi Sonia,

 

Thanks heaps for your help with my line pacing question. I also figured out where to add the code you mentinoed to get line spacing between the subcategories.

 

Two questions if I might, and feel free to tell me to go away:

 

1. Is it possible to apply the spacing to all but the first line? I notice that the code you have given put the pixel_trans.gif at the end of the first line as well and it ends up padding the first line from the top of the box. i.e. the categories are no longer centered vertically in the box.

 

2. Do you know how to add a horizontal rule between each category?

 

Like i said, feel free to send me elsewhere but though I'd ask anyway.

 

Thanks a bunch

 

Scott

Forgot

 

To not space at the top you would need to remove the previous location of the image and do this:

 

  while ($categories = tep_db_fetch_array($categories_query))  {
  if ($row == 0) {
  $spacer = '';
 } else {
$spacer = tep_draw_separator('pixel_trans.gif', '1', '15');
 }
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'] . $spacer,
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
$row++;
 }

Sonia

Here is where you need to add the tags in catelog/includes/boxes/categories.php

find this code

	if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= '?(' . $products_in_category .')';
  }
}

$categories_string .= '<br>';

change to this to add a bigger space and a horrizontal line

	if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= '?(' . $products_in_category .')';
  }
}

$categories_string .= '<p><hr color="red">';

The color can be like this also color="#000000" etc. or not there at all.

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...