Zen Cart Logo
Forums / Addon Sideboxes / Expanded Category Sidebox, spacing between categires

Expanded Category Sidebox, spacing between categires

Locked

Views: 7,006

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
11 Jan 2007, 3:02 AM
#1
jmatthewsr avatar

jmatthewsr

New Zenner

Join Date:
Dec 2006
Posts:
13
Plugin Contributions:
0

Expanded Category Sidebox, spacing between categires

Hi,
With http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_52&products_id=392

Is it possible to add separation space between categories?

Category 1

  • sub-category
  • sub-category
    <insert additional space here>
    Category 2

I looked at the CSS styles, but there are only class names for the <a> link and they are not block-level elements, so padding,margin settings don't seem to work. Could the code be updated to include a div or other block element around the categories so that padding/margin can be added in the css?

thanks!
-justin

11 Jan 2007, 3:15 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Expanded Category Sidebox, spacing between categires

I am not much for design but wouldn't you add spacing or padding to the:

A.category-top, A.category-top:visited {
color: #008000;
text-decoration: none;
}

11 Jan 2007, 4:38 AM
#3
clydejones avatar

clydejones

Deceased

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

Re: Expanded Category Sidebox, spacing between categires

Yes, you can add padding to these elements:

A.category-top, A.category-top:visited {
color: #008000;
text-decoration: none;
padding-bottom: 10px;
}

or you could try this:

#categorylistbox .category-top a {
color: #008000;
text-decoration: none;
padding-bottom: 10px;
}

11 Jan 2007, 2:32 PM
#4
jmatthewsr avatar

jmatthewsr

New Zenner

Join Date:
Dec 2006
Posts:
13
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

Thanks for the feedback. The above examples didn't work, so after a bit of research:
http://www.w3.org/TR/REC-CSS2/box.html#box-dimensions
http://www.w3.org/TR/REC-CSS2/visuren.html#q5

Here is what worked the best for me (it could be made simpler, but I explicitly stated margin vs padding):

.category-top {
display:block;
/*uncomment to help with visual display
border-width:1px;
border-style:dashed;
*/
padding-top:0px;
padding-bottom:0px;
margin-top:10px;
margin-bottom:0px;
}

11 Jan 2007, 7:25 PM
#5
clydejones avatar

clydejones

Deceased

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

Re: Expanded Category Sidebox, spacing between categires

Glad you got it solved and I'm sure the information will benefit others as well.

19 Jun 2009, 11:03 AM
#6
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

This has worked perfectly for me too, thanks! :D

My only other query is how can I now centre the category titles? I feel they may look better if centred, especially the ones that appear on two lines.

Thanks

19 Jun 2009, 11:52 AM
#7
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

also, have just noticed that the spacing between the main cats is perfect but it doesnt seem to put a space bewteen the last sub cat 'Wall Art, Mirrors & Decorative' and the next main cat 'lifemax' how can I make a space between these two without making the space between the other main cats increase. (I dont want the gaps too big)

Thanks.

28 Apr 2010, 3:55 PM
#8
mr_chetanladdha avatar

mr_chetanladdha

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

Hi,

Actually, i couldnt understand to which file is this code to be added and where.

I couldnt locate the file and the place where this code is to be added.

Please help and thanks in advance all gurus.

Regards
Chetan

29 Apr 2010, 12:16 PM
#9
klim avatar

klim

New Zenner

Join Date:
Apr 2010
Posts:
26
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

I'm waiting with baited breath on this one too. Have been sitting confused for a day or two not being able to figure how to make my categories look nice...

29 Apr 2010, 12:28 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Expanded Category Sidebox, spacing between categires

You would add the rules mentioned to your template's stylesheet.css.
Actually, just making the links display: block; will introduce another problem, in that there is a <br /> between every category to keep the original inline elements on their own lines, and this will add extra space when the links are turned to block display. You need to edit /includes/templates/your_template/sideboxes/tpl_categories.php and remove the <br /> that follows the category link building. If you are uncomfortable editing PHP code, you can use Categories Dressing which takes care of that and has a multitude of other styling/organization possibilities.

29 Apr 2010, 12:37 PM
#11
klim avatar

klim

New Zenner

Join Date:
Apr 2010
Posts:
26
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

Thanks for that - discovered it myself a couple of minutes ago, but am glad you addressed my next question before I asked it about the extra <br /> !

30 Apr 2010, 9:05 AM
#12
mr_chetanladdha avatar

mr_chetanladdha

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

Thanks for the replies everyone.
Now, that i know that the code needs to be added in the stylesheet.css , the other question is where in stylesheet.css should i paste this code ?

.category-top {
display:block;
/*uncomment to help with visual display
border-width:1px;
border-style:dashed;
*/
padding-top:0px;
padding-bottom:0px;
margin-top:10px;
margin-bottom:0px;
}

Should i paste it at the bottom of the stylesheet.css or what ?

Thanks
Chetan

1 May 2010, 6:15 AM
#13
mr_chetanladdha avatar

mr_chetanladdha

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Expanded Category Sidebox, spacing between categires

After a lot of trial and error.
I added it at the end of code.
Disabled the category counts and now its as required.
Just that now i want to change the colour of the category texts.

Thanks a tonne all for helping.

Chetan