Forums / Templates, Stylesheets, Page Layout / How do I add the bar symbol (|) in category menu?

How do I add the bar symbol (|) in category menu?

Locked

Views: 2,392

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
10 Jul 2009, 12:18 PM
#1
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

How do I add the bar symbol (|) in category menu?

Trying to figure out where I edit the uppernav category listing to put a bar "|" in between each category as a seperator. Can anyone point me to the file this is done in? Thanks.

10 Jul 2009, 2:35 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I add the bar symbol (|) in category menu?

Trying to figure out where I edit the uppernav category listing to put a bar "|" in between each category as a seperator. Can anyone point me to the file this is done in?
Have a look in a copy or your template copy of tpl_header.php and look for cat tabs

Zen-Venom Get Bitten

10 Jul 2009, 5:16 PM
#3
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

kobra:

Have a look in a copy or your template copy of tpl_header.php and look for cat tabs

Not there. A function is called that builds the string there. Need to figure out where the function originates from tht actually builds the string.

<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>

Above is the code. The last line should of been an indicator, but wasn't. It contains yet another function being called from somewhere.

Hoping for someone to point the exact location and file name I need to edit.

10 Jul 2009, 5:29 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: How do I add the bar symbol (|) in category menu?

/includes/templates/your_template/templates/tpl_modules_categories_tabs.php

Copy from /includes/templates/template_default/templates/tpl_modules_categories_tabs.php and edit in your custom folder.

10 Jul 2009, 6:19 PM
#5
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

gjh42:

/includes/templates/your_template/templates/tpl_modules_categories_tabs.php

Copy from /includes/templates/template_default/templates/tpl_modules_categories_tabs.php and edit in your custom folder.

Can you post sample code to that function...I am crashing the menu and the website if I attempt to append the string. Apparently, I am not doing it right or Zen Cart is not interpreting PHP the traditional way.

10 Jul 2009, 10:20 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I add the bar symbol (|) in category menu?

Can you post sample code to that function...I am crashing the menu and the website if I attempt to append the string. Apparently, I am not doing it right or Zen Cart is not interpreting PHP the traditional way.
Zen Cart does not have a license to alter php parsing...

Post the original line(s) and your edited line(s)
Use the # Code tag

Zen-Venom Get Bitten

11 Jul 2009, 3:52 AM
#7
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

kobra:

Zen Cart does not have a license to alter php parsing...

Post the original line(s) and your edited line(s)
Use the # Code tag

Cant posted edit lines, mainly because when they didn't work, I restored the original code. Would help if the sample code was just posted here, because every post I did in the last few months, I got answers in bits and pieces and confusicates the hell outta me.

Below is the line of code I am trying to figure out how to use the bar symbol to separate the categories:

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

The problem is when I look at that code it shows a function and when I search out those functions, I get led to yet another location. I just don't know where to look. Zen Cart is confusing sometime until you get time to do an indepth study of the code.

Below is the block of code from tpl_modules_categories_tabs.php that I ATTEMPTED to edit and was not successful:

<div id="navCatTabsWrapper">
<div id="navCatTabs">
<ul>
<?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
  
  <li><?php echo $links_list[$i];?></li>
  
<?php } ?>
</ul>
</div>
</div>

I am wanting it to loop where if it is not = $n that the bar symbol is appended to the string that is displayed at: http://arcademprosoftware.com. Basically like this:

Category 1 | Category 2 | Category 3

11 Jul 2009, 4:05 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: How do I add the bar symbol (|) in category menu?

You presumably want the separator only between the categories and not before or after the list, so here is an example that puts a "pipe" before items except for the first item:```php

<li><?php echo (($i > 0)? '|' : '') . $links_list[$i];?></li> ``` You can add spaces before & after the pipe if desired: ' | '
11 Jul 2009, 1:32 PM
#9
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

gjh42:

You presumably want the separator only between the categories and not before or after the list, so here is an example that puts a "pipe" before items except for the first item:```php

<li><?php echo (($i > 0)? '|' : '') . $links_list[$i];?></li> ``` > You can add spaces before & after the pipe if desired: > ' | '

Ahh...that's hwo Zen Cart does it. The pipe symbol dont show through. But what it DOES do is add an empty space between the categories, so I know we are on the right track. Do I have to use special functions or something to get the pipe symbol to show through? You are correct. I want it between the categories, not before or after. And thanks. Now if we can get that pipe symbol to show through as the seperator.

11 Jul 2009, 1:48 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: How do I add the bar symbol (|) in category menu?

Try a different character in place of the pipe, or something like 'x|x', to see if it really tests correctly.
The pipe is not a special character in PHP and shouldn't need escaping.

$links_list[$i] is the "$i-th" element of $links_list, starting with 0 as is standard in PHP.

11 Jul 2009, 2:15 PM
#11
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

gjh42:

Try a different character in place of the pipe, or something like 'x|x', to see if it really tests correctly.
The pipe is not a special character in PHP and shouldn't need escaping.

$links_list[$i] is the "$i-th" element of $links_list, starting with 0 as is standard in PHP.

Did that, put an X there to see if it even works. It dont test correctly.

11 Jul 2009, 6:55 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: How do I add the bar symbol (|) in category menu?

It's pretty simple code, and ought to work. Can you post exactly what you have in that line?
Maybe try a debug output: add to the echo 'i=' . $i .

  <li><?php echo ' i=' . $i . (($i > 0)? '|' : '') . $links_list[$i];?></li>
12 Jul 2009, 3:25 AM
#13
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

gjh42:

It's pretty simple code, and ought to work. Can you post exactly what you have in that line?
Maybe try a debug output: add to the echo 'i=' . $i .

<li><?php echo ' i=' . $i . (($i > 0)? '|' : '') . $links_list[$i];?></li> ```

I tried both ways using the $n and $i variable. What it did do was add an additional space between the categories. There has to be something in Zen Cart's code that wont let this get through.

You can see the results so far at http://arcademprosoftware.com. I could post you what I got there but it's exactly what I posted before. I do not keep variations of code on my server if it don't work the first time.

I haven't even backed up yet, though I need to.

12 Jul 2009, 7:31 AM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I add the bar symbol (|) in category menu?

I could post you what I got there but it's exactly what I posted before.
All that I see that you have posted is your for loop
Really hard to assist when you do not post what code you are using
But what it DOES do is add an empty space between the categories
Not sure which varation you are using right now BUT there is more than a space there highlight the area and you will see there is "n=10" in between each and your view source is

<li> n= 10|<a class="category-top"...

Post the code you are using

Zen-Venom Get Bitten

13 Jul 2009, 12:12 AM
#15
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

kobra:

All that I see that you have posted is your for loop
Really hard to assist when you do not post what code you are using

Not sure which varation you are using right now BUT there is more than a space there highlight the area and you will see there is "n=10" in between each and your view source is

<li> n= 10|<a class="category-top"... ``` > Post the code you are using

ahhh..... font color is same as background color that's the issue all along. THanks.
:cry::frusty:

13 Jul 2009, 1:17 AM
#16
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I add the bar symbol (|) in category menu?

ahhh..... font color is same as background color that's the issue all along
And only took 15 posts because you failed to post your code

Zen-Venom Get Bitten

13 Jul 2009, 1:59 AM
#17
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

kobra:

And only took 15 posts because you failed to post your code

The code I used was the code you gave me, which is what I am referring to. I would of just been reposting your code sample that was already posted. I don't like to repost code that's already in the thread. It turned out to be a CSS issue and not code.

13 Jul 2009, 2:03 AM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I add the bar symbol (|) in category menu?

The code I used was the code you gave me, which is what I am referring to.
I provided NO code!
But asked you for what you were using several times

Zen-Venom Get Bitten

13 Jul 2009, 2:10 AM
#19
dmm2020 avatar

dmm2020

Zen Follower

Join Date:
Feb 2009
Posts:
157
Plugin Contributions:
0

Re: How do I add the bar symbol (|) in category menu?

kobra:

I provided NO code!
But asked you for what you were using several times

Ooops sorry. I was using what gjh42 posted.