Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding a space in between sidebox entries

Adding a space in between sidebox entries

Locked

Views: 2,278

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
8 Aug 2006, 6:24 PM
#1
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Adding a space in between sidebox entries

in my main sidebox with the categories, id like to create a blank line. all the entries are close together and i would like one to stand out. a blank line would do this nicely. is this possible? couldnt find anything under the search. probably searching the wrong words.

thanks again,
M

8 Aug 2006, 6:30 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding a space in between sidebox entries

Make a copy of template_default/sideboxes/tpl_categories.php in your customer template. Open it in your favourite editor and you will find instructions for what you want to do in lines 16-18 and example code ready to edit in lines 19-21.

8 Aug 2006, 6:52 PM
#3
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

understood. however im new to css. how do i add a "new line" or <BR> in the class definition?

8 Aug 2006, 7:01 PM
#4
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

and im totally not understanding how to do this either. the instructions in the comments i mean. they seem pretty technical.

8 Aug 2006, 7:29 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding a space in between sidebox entries

// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;

Let's break it down.

If it doesn't already exist, create a new directory in YOUR_TEMPLATE called sideboxes and copy template_default/sideboxes/tpl_categories.php into it.

Open the new file ready for editing.

In Admin > Categories/Products where you created the category you want to highlight, look in the left hand column and you will find the categories_id that will replace the number 3 in the first red line above.

Decide on a descriptive word for this special category and use it instead of holiday in the second red line above (and the CSS that I have written for you below).

Then remove the // at the beginning of each of the red lines.

Save and upload to your site.

Open your stylesheet and add the following at the bottom:

.category-holiday {

padding: 5px 0;
color: green;
}This will add 5px of space above and below your special category and turn it green. There is no need for any <br /> tags.

9 Aug 2006, 6:44 AM
#6
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

ok getting closer. but still not working.

first thx!

ok. ive edited the tpl_categories.php file properly (the override one). it now is uncommented, has the right category id and name of the class which i called "category-designs"

i think my problem is in the stylesheet.

I put your code at the bottom of the override stylesheet. but i didnt know which one to put it in.

stylesheet.css
stylesheet_original.css
stylesheet_new.css

then i tried putting it in them all and didnt get anything. can i ask you which stylesheet to put the code in?

oh fyi, i modified your code. the class is called category-designs and not holiday.

many many thx.
m

9 Aug 2006, 6:53 AM
#7
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

actually, after viewing the page in firefox, it appears that there is a 5px pad around the category now. but it simply overlaps the other category links. doesnt create any additional space. any ideas? plz and thx thx thx!

9 Aug 2006, 7:00 AM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding a space in between sidebox entries

This should be very easy to debug if I can see it in action. Do you have a link to the site where I can see it?

9 Aug 2006, 7:16 AM
#9
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

yes no problem sorry.

its footnotelabs.com

the designs category is what id like a line down (essentially).

9 Aug 2006, 8:01 AM
#10
mcsilvio avatar

mcsilvio

New Zenner

Join Date:
Jun 2005
Posts:
78
Plugin Contributions:
0

Re: Adding a space in between sidebox entries

just added a category called " " in between. seems to have worked. many thanks brothers!

9 Aug 2006, 8:22 AM
#11
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding a space in between sidebox entries

If you add "display: block" to the CSS the padding will show up.

You have a bigger problem however, with these stylesheets and you're already beginning to see the effects. You should not have all three and unless you have a good understanding of the rules of precidence an extremely retentive memory for the detail of each, you will keep tripping over yourselve trying to work out where to put stuff and whether it isn't working 'cos you got it wroing, or because something in one of the other stylesheets is over-riding it.

Your stylesheet.css is rather old - I don't now where you got that from. The other two are as a result of using the Classic Template. This template is intended primarily for backward compatibility with earlier versions of Zen Cart and has been hacked about somewhat to achieve this making for a rather more complex stylesheet than a new site needs and more tables-based layout than is the case for a completely clean installation based on the template_default.

It would be better to build your own template from scratch based on the functionality in the template_default. A little more work up front, but much, much easier in the long-term.

If you want to continue on your current path, then migrate any changes you have made to stylesheet.css and stylesheet_original.css to stylesheet.new.css and work in that one only, and delete stylesheet.css from your template directory.