Forums / Templates, Stylesheets, Page Layout / Enable Categories Links in Sidebox

Enable Categories Links in Sidebox

Views: 985

Results 1 to 12 of 12
29 Sep 2011, 8:15 AM
#1
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Enable Categories Links in Sidebox

In case I don't explain myself well enough, I am having the exact same problem as described in this old thread:

http://www.zen-cart.com/forum/showthread.php?t=136874

My main categories on my homepage open up to show their sub-categories when I click on them, they don't take me to their specific webpage.

I want it so that when I click on a parent category in the sidebox, it will open to that page, instead of just cascading down to show its sub-categories. The code in my categories.php file is far too complex for me to have any clue what to do about it.

I was hearing about something called YahooTreeMenu that can do it but can't find anywhere to download it. I came across a demo website that had it implemented and it's perfect because it not only opens to the category page when clicked, but it also opens to show its sub-categories at the same time: http://demo.zen-cart.org.ua/

29 Sep 2011, 10:58 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Enable Categories Links in Sidebox

It's possible I don't understand your question, but the behavior shown in the demo site you referenced is the stock Zencart behavior (see www. stevesh.org/demo), so we'll need to see your site to advise.

29 Sep 2011, 12:10 PM
#3
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Re: Enable Categories Links in Sidebox

my website is https://www.oldewatches.com.

If that is the default zencart category thing, is it possible to just somehow get the original categories.php and overwrite my one? Or are there other things that need to be changed as well?

I tried overwriting it with one that was similar, but it just screwed the categories up.

29 Sep 2011, 1:19 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Enable Categories Links in Sidebox

What's your setting in Admin - Configuration - Product Listing - Show SubCategories on Main Page while navigating

30 Sep 2011, 4:02 AM
#5
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Re: Enable Categories Links in Sidebox

It was on, set to 1. I set it to 0 and nothing changed at all, I believe my website is heavily customized (I didn't design it) so lots of things via admin don't really work or show up.

Pretty much now what I'm having to do is get an original tpl_categories.php file and narrowing down any differences between it and my current tpl_categories.php. I have absolutely no idea which part of the code to change, but it's trial and error.

30 Sep 2011, 4:20 AM
#6
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Re: Enable Categories Links in Sidebox

Ok, I think I found a solution, or rather the part of the code that needs changing. Maybe this isn't the exact proper way to do it, but it will have to do.

if($new_style=='category-subs'){
		if ($k==0) $content .= '</ul>';
      $content .= '<h2><a href="javascript:void(0)">'.$box_categories_array[$i]['name'].'</a></h2>'."\n";
	   $content .='<ul>'. "\n";
	  $k=0;

This part, when I change the javascript part in <a href="javascript:void(0)"> to say, my homepage, when I click on the brand it takes me to the homepage. Obviously, this applies for all brands and I need it so that when I click on a brand, it takes me to that specific page.

Does anyone know that correct zencart code or whatever to place there so that each brand will take me to its respective page? I'm guessing it might be something like zen_href_link(FILENAME_DEFAULT

30 Sep 2011, 5:36 AM
#7
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Enable Categories Links in Sidebox

I will freely admit i have no knowledge of this particular mod or whatever, BUT, have you looked in

admin --> Tools --> Layout boxes controller

and see if the actual categories box is turned on.

The reason i ask is there was a mod (I think) that had its own seperate categories box that you turned on, while at the same time you would turn off the mormal categories box

Webzings Design
Semi retired from Web Design

30 Sep 2011, 5:54 AM
#8
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Re: Enable Categories Links in Sidebox

nigelt74:

I will freely admit i have no knowledge of this particular mod or whatever, BUT, have you looked in

admin --> Tools --> Layout boxes controller

and see if the actual categories box is turned on.

The reason i ask is there was a mod (I think) that had its own seperate categories box that you turned on, while at the same time you would turn off the mormal categories box

yes I have, there are two there. ch_categories.php and categories.php. I enabled/disabled both of them to check any differences, and the normal categories.php one doesn't work at all. I still check both of them when I make changes to see if it will hopefully work with one or the other. The only difference is that with ch_categories, I click on a brand and it unfolds to show sub-categories, but with categories.php, it does nothing, since the brand's URL is as above: <a href="javascript:void(0)">

30 Sep 2011, 5:57 AM
#9
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Enable Categories Links in Sidebox

I think you are using the "Click-Show-Hide" mod, try doing a search on that and see if anyone else has had a similar issue

http://www.zen-cart.com/forum/showthread.php?t=159585

That thread seems promising.

It shouldn't effect the functionality of the normal categorys box, that seems odd

Webzings Design
Semi retired from Web Design

30 Sep 2011, 6:05 AM
#10
psykryph avatar

psykryph

New Zenner

Join Date:
Dec 2010
Posts:
52
Plugin Contributions:
0

Re: Enable Categories Links in Sidebox

nigelt74:

I think you are using the "Click-Show-Hide" mod, try doing a search on that and see if anyone else has had a similar issue

http://www.zen-cart.com/forum/showthread.php?t=159585

That thread seems promising.

It shouldn't effect the functionality of the normal categorys box, that seems odd

I'm pretty sure I don't have that mod, but is there any way to check if I am? According to the description page of that mod, it seems that it's exactly what my website is doing, but the newest version was for zencart version 1.3.7, and I'm not using that.

30 Sep 2011, 3:06 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Enable Categories Links in Sidebox

Mod versions will often work on newer versions of Zen Cart than the one they were written for, so that is not necessarily the problem. The categories sidebox files have not been changed since v1.3.5, so mods for it ought to still work. The javascript in there suggests Click-Show-Hide; you definitely do not have the basic ch_categories mod, which shows all of the categories and subs all the time, as plain <a> links. You could be missing the javascript files which make top links in the mod you have work.

Do you have a file /includes/modules/sideboxes/your_template/categories.php? Or is there just /includes/modules/sideboxes/categories.php?
If you have a custom copy of that file, rename it temporarily to categories.bak and see if the stock version takes over and works normally.

30 Sep 2011, 3:23 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Enable Categories Links in Sidebox

Looking at your site again, your ch_categories box is a highly modified version using definition lists ( <dl> ) and CSS to show or hide appropriate subcategories. It appears to be working as designed.

You don't have the categories.php sidebox active, so there is nothing more to say about that now.