Forums / Basic Configuration / how to put a line between categories?

how to put a line between categories?

Views: 7,400

Results 1 to 20 of 36
4 Feb 2007, 7:27 PM
#1
lina0962 avatar

lina0962

Zen Follower

Join Date:
Jun 2006
Posts:
403
Plugin Contributions:
0

how to put a line between categories?

I want to seperate categories with lines in the category sidebox, just like there is a line between "new products" and categories. How can I do that?

Also, I want to add a little triangle in front of each category. How can I do that?

Thank you very much for instructions!

Lina

5 Feb 2007, 3:46 AM
#2
kaefee avatar

kaefee

New Zenner

Join Date:
Jan 2007
Posts:
40
Plugin Contributions:
0

Re: how to put a line between categories?

Look for this file:

includes/templates/YOUR_TEMPLATE/sideboxes/**tpl_categories.php

**and change this :

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 .=[B] '<br />' .[/B] "\n";
```by this

  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 .= [B]'<hr id="catBoxDivider" />' [/B]. "\n";
16 May 2010, 8:17 PM
#3
courage9 avatar

courage9

New Zenner

Join Date:
Jan 2009
Posts:
74
Plugin Contributions:
0

Re: how to put a line between categories?

Using V1.3.9b

Current with all updates.

I'm just trying to figure out how to add lind separators between each item in my "EZ PAGE SIDEBOX"

I read what was listed here, and tried to apply that fix to my "tpl_ezpages.php", but it wouldn't work. I could only get lines at the beginning of the box and at the end, but not between each ezpage????

You can see what I mean by looking at the page here: https://www.celebrityapparel.net

This is my ezpage code:
/* $content .= '</ul>' . "\n";*/
$content = '<hr id="catBoxDivider" />';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
} // end FOR loop
$content .= '<hr id="catBoxDivider" />' . "\n";
$content .= '</div>';
?>

Thanks

19 May 2010, 8:41 PM
#4
courage9 avatar

courage9

New Zenner

Join Date:
Jan 2009
Posts:
74
Plugin Contributions:
0

Re: how to put a line between categories?

:censored:Am I that ignorant? I've followed the directions in the help section, but to no avail. Please -- anyone.. I know it's something so easy that I'm missing...but that's what is making it so hard. I'm blinded by my own mind...:cry:

19 May 2010, 11:12 PM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: how to put a line between categories?

Courage9:

Using V1.3.9b

Current with all updates.

I'm just trying to figure out how to add lind separators between each item in my "EZ PAGE SIDEBOX"

I read what was listed here, and tried to apply that fix to my "tpl_ezpages.php", but it wouldn't work. I could only get lines at the beginning of the box and at the end, but not between each ezpage????

You can see what I mean by looking at the page here: www.celebrityapparel.net

This is my ezpage code:
/* $content .= '</ul>' . "\n";*/
$content = '<hr id="catBoxDivider" />';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
} // end FOR loop
$content .= '<hr id="catBoxDivider" />' . "\n";
$content .= '</div>';
?>

Thanks

Try this:

/* $content .= '</ul>' . "\n";*/
$content = '<hr id="catBoxDivider" />';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$content .= '<hr id="catBoxDivider" />';
$content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
} // end FOR loop
$content .= '<hr id="catBoxDivider" />' . "\n";
$content .= '</div>';
?>

  1. the highlighted red font is the fix...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

20 May 2010, 6:43 PM
#6
courage9 avatar

courage9

New Zenner

Join Date:
Jan 2009
Posts:
74
Plugin Contributions:
0

Re: how to put a line between categories?

I knew it was easy....Thanks:clap: Your the best! Yes it worked perfectly...I just forgot how to do it.

20 May 2010, 7:34 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: how to put a line between categories?

Note that if you are using this in several places on one sidebox or page, you should not call it <hr id="catBoxDivider" /> but <hr class="catBoxDivider" />.
An id is supposed to be unique on a page. You can style
.catBoxDivider {}
however you like in your stylesheet.

Also, for any sidebox that uses a <ul> or otherwise has its elements in block-type display, you don't need to edit the template file at all. You can use a stylesheet rule to put a top or bottom border on the items.

20 May 2010, 7:46 PM
#8
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: how to put a line between categories?

Your Welcome.. :smile:

Nice explanation of the function of the stylesheet...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

28 May 2010, 11:53 AM
#9
daltonkost avatar

daltonkost

Zen Follower

Join Date:
Oct 2009
Location:
Smack in the Middle
Posts:
127
Plugin Contributions:
0

Re: how to put a line between categories?

Thanks Guys!

<hr class="catBoxDivider" />.

This worked well for me on both the category and ez page sidebox. Nice evenly spaced lines.

I'm assuming it will work on the information sidebox as well, but haven't tried it yet.

Dalton

Skin that 'un pilgrim, and I'll bring ya' another.
Running 1.3.9h with a few mods here

28 May 2010, 12:09 PM
#10
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: how to put a line between categories?

Yes, you are very correct.. :smile:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

23 Jun 2010, 7:17 PM
#11
iluvedancin avatar

iluvedancin

New Zenner

Join Date:
Nov 2009
Location:
england
Posts:
36
Plugin Contributions:
0

Re: how to put a line between categories?

:clap: YEY... been tryna figure out this catagories hr business and found your post. No problems what so ever so thank you sooo much for your input.. most helpful. :bigups:

My new shop has been a burning passion for so long and I only wish I found ZEN CART sooner! But hey, got it now n I LOVE IT. Thank you ZEN. https://www.designawardrobe.com

24 Jun 2010, 6:47 AM
#12
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,185
Plugin Contributions:
0

Re: how to put a line between categories?

Yes, the search function is dynamic, time saving and educational by taking the time to phrase your question and read similar threads on your issue...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

23 Jul 2010, 10:29 AM
#13
daltonkost avatar

daltonkost

Zen Follower

Join Date:
Oct 2009
Location:
Smack in the Middle
Posts:
127
Plugin Contributions:
0

Re: how to put a line between categories?

After adding $content .= '<hr class="catBoxDivider" />'; to tlp_ezpages.php WC3 Validation Service gives the following errors.

Line 105, Column 28: document type does not allow element "hr" here; assuming missing "li" start-tag

<hr class="catBoxDivider" /><li><a href="http://fortywinksonline.com/index.php?…

and this one

Line 105, Column 32: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

<hr class="catBoxDivider" /><li><a href="http://fortywinksonline.com/index.php?…? The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

Any ideas on how to get it to validate?

BTW, this edit to tlp_categories.php does not return any validation errors, and both sideboxes (categories and ez pages) are working fine.

Thanks

Dalton

Skin that 'un pilgrim, and I'll bring ya' another.
Running 1.3.9h with a few mods here

23 Jul 2010, 2:18 PM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: how to put a line between categories?

Eliminate the PHP file edit, and add to your stylesheet

#ezpagesContent li {border-top: 1px solid #112277;}

Adjust color as required.

23 Jul 2010, 4:51 PM
#15
daltonkost avatar

daltonkost

Zen Follower

Join Date:
Oct 2009
Location:
Smack in the Middle
Posts:
127
Plugin Contributions:
0

Re: how to put a line between categories?

Thanks!!!

Changed per your instructions, no more validation errors.

Ever Grateful

Dalton

Skin that 'un pilgrim, and I'll bring ya' another.
Running 1.3.9h with a few mods here

24 Jul 2010, 10:48 AM
#16
vito avatar

vito

Zen Follower

Join Date:
Mar 2006
Posts:
182
Plugin Contributions:
0

Re: how to put a line between categories?

When using $content .= '<hr id="catBoxDivider" />' . "\n"; in tpl_categories.php, how do you set the color for the hr?

Vito

26 Jul 2010, 2:15 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: how to put a line between categories?

First, don't use id="catBoxDivider" as that is already in use. Use class="catBoxDivider".

Add to your stylesheet

.catBoxDivider {color: #aabbcc;}

Adjust color as required.
If you want these dividers and the original one the same color, make it

#catBoxDivider, .catBoxDivider {color: #aabbcc;}

14 May 2011, 2:54 AM
#18
cameo avatar

cameo

Zen Follower

Join Date:
Nov 2009
Location:
Ohio
Posts:
100
Plugin Contributions:
0

Re: how to put a line between categories?

lina0962:

I want to seperate categories with lines in the category sidebox, just like there is a line between "new products" and categories. How can I do that?

Also, I want to add a little triangle in front of each category. How can I do that?

Thank you very much for instructions!

Lina

I want my category sidebox to have the hr line I think I did that right, but I still can not figure out how to add those little triangles in front of each category and each sub-category. How do I do that?

I want it to look like this site:

http://fortywinksonline.com

Here is my site:

http://www.sexysensualseductivelingerie.com

I have read everything in this Thread, but I'm still not sure what to do.

Thanks,

cameo

14 May 2011, 3:15 AM
#20
cameo avatar

cameo

Zen Follower

Join Date:
Nov 2009
Location:
Ohio
Posts:
100
Plugin Contributions:
0

Re: how to put a line between categories?

lina0962:

I want to seperate categories with lines in the category sidebox, just like there is a line between "new products" and categories. How can I do that?

Also, I want to add a little triangle in front of each category. How can I do that?

Thank you very much for instructions!

Lina

(Please disregard my previous post I tried to edit it, but was not within the time frame, so I couldn't make my changes.)

Below is my question:

I want my category sidebox to have the hr line I think I did that right, but I still can not figure out how to add those little triangles in front of each category and each sub-category. How do I do that?

Also, I think the hr lines are in the wrong places because when you click on ######## Missy Lingerie the drop down box shows the sub-categories which are:

Baby Dolls
Bra Sets
Bustiers
etc

the should not have the hr line I want dashes beside them like this:

-Baby Dolls
-Bra Sets
-Bustiers
etc

And I want ######## Missy Lingerie the have the little triangle beside it.

I want it to look like this site:

Here is my site:

http://www.sexysensualseductivelingerie.com

I have read everything in this Thread, but I'm still not sure what to do.

Thanks,

cameo