Re: Parent Categories Separated In 3 sideboxes
i got it working....Yay....it was my bad i was playing around with the document type trying to clone it for duplicating the sideboxes and i set the category to restrict to only the document box.
it works perfectly, it will be time consuming adding all categories this way, as i have hundreds of them but i don't care it works*L*
thank you so much for all your help, its more appreciated then you will ever know. im so excited this is working:smile:
Re: Parent Categories Separated In 3 sideboxes
ok so once again i jumped the gun, it works perfectly in the original categories sidebox but it wont work in the cloned sideboxes. it shows the sidebox but its empty. i named the other categories sidexboxes
tpl_categories2.php,tpl_categories3.php and tpl_categories4.php
im thinking maybe i need to change file name or something like this, im just not sure what
im going to work on it and see what i can do but if you or anyone has a clue i would love to hear it.
here is the site incase you need to see it.
i named the original categoreis box to adult the one that is not working is pets which is tpl_categories2.php
http://www.gothenaturalway.com
Re: Parent Categories Separated In 3 sideboxes
As you probably already found and corrected, this code
PHP Code:
$cPTest = $box_categories_array[$i]['path'];
if (($cPTest == 'cPath=3') or ($cPTest == 'cPath=7') or($cPTest == 'cPath=7_25')) }
has a typo: the last } is supposed to be a {.
I'm afraid I can't help with the cloned files, as far as any changes that have to be made. I can only give one speculation or question: does the first executed box reset some info so it is not available to others? or does the last one overwrite what previous ones have done?
Good luck, and I'll be watching for developments.
Re: Parent Categories Separated In 3 sideboxes
yes i did catch the type, thanks alot.
yeah i dont even know how to go about finding out if the first executed box resets some info so it is not available to others or if the last one overwrites what previous ones have done. i know its a cloning issue, as far as i know i have cloned right i have done this many times before, but there is something stopping the changes in all the other category sideboxes. if anyone has a clue i would love to hear it.
Glenn thanks so much for all your help.
Re: Parent Categories Separated In 3 sideboxes
Working on a similar project, I just realized that I had neglected to check my syntax against the example in tpl_main_page.php when I knew the same method was used there.
PHP Code:
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) {
does work correctly; the numbers need to be in one string with comma separators, not individual strings. Doh!
That should make your selection statements easier to write and read.
Re: Parent Categories Separated In 3 sideboxes
Ohhhhhhh i could just kiss you
thank you thank you thank you. That not only makes adding the cats so much easier it also fixed the problem with the cloned sideboxes, it must have been the syntax that was off making the clones not work.
i cant thank you enough for all your help, it was very nice of you to waste so much time helping me.:smile:
Re: Parent Categories Separated In 3 sideboxes
I followed these instructions and I can get it to work if I am linking to a top category, but if I am linking to a subcategory (example 141_145) it doesn't seem to work. Has anyone been able to get this to work for linking to subcategories?
Re: Parent Categories Separated In 3 sideboxes
I'm not sure at first glance why this wouldn't be working for you, but I do have two comments:
(off topic) From view source, you are missing a closing > in this img tag on your home page:
HTML Code:
<a href="http://www.fatvanish.com" target="_blank"><img src="images/frontpagefatvanish.gif" width="220" height="276" alt="Learn How to Lose Weight (Fat) at www.FatVanish.com"</a></center>
The way you have your multiple category boxes arranged and styled, you could achieve the exact same effect with Categories Dressing using non-linked headings, and much less coding.
For the multiple boxes:
Can you post the line where you test for cPaths to display? I presume you are using a version of this
PHP Code:
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) {
Re: Parent Categories Separated In 3 sideboxes
Quote:
Originally Posted by
gjh42
I'm not sure at first glance why this wouldn't be working for you, but I do have two comments:
(off topic) From view source, you are missing a closing > in this img tag on your home page:
HTML Code:
<a href="http://www.fatvanish.com" target="_blank"><img src="images/frontpagefatvanish.gif" width="220" height="276" alt="Learn How to Lose Weight (Fat) at www.FatVanish.com"</a></center>
Thanks for that info. I have now fixed that.
Quote:
Originally Posted by
gjh42
The way you have your multiple category boxes arranged and styled, you could achieve the exact same effect with Categories Dressing using non-linked headings, and much less coding.
I never even looked into this. I just found this post and it looked like it would accomplish what I was looking for, so that's what I did. Out of curiousity, would there be a way using either the methods discussed in this thread, or with the categories dressing mod to have a category link directly to a different website? Underneath our Diet & Exercise Routines heading, I would like to have a category called "Muscle Building Program" that links to MuscleNOW.com (opening in a new window), and "Weight Loss Program" that links to FatVanish.com (also opening in a new window) instead of linking to a page within Zencart. Is there a way I could do this considering I'm pretty limited in PHP knowledge?
Quote:
Originally Posted by
gjh42
For the multiple boxes:
Can you post the line where you test for cPaths to display? I presume you are using a version of this
PHP Code:
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) {
Below is that code:
PHP Code:
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'81,69,156,66'))) {
Re: Parent Categories Separated In 3 sideboxes
The select part is simple - you are not asking for the subcategories to be displayed:
explode(",",'81,69,156,66')
This will display top categories 81, 69, 156 and 66, but you also need to specify all of their subcategories individually.
PHP Code:
explode(",",'81,81_199,81_200,81_203,69,69_177,69_178,156,156_235,156_236,66,66_212,66_213')
The code could be reworked to do this automatically, but I didn't get into that at the time since the original code worked.