I'm having a problem displaying the subcategory in my custom drop down navigation correctly.
What I'd like to show is just the subcategory names for the CURRENTLY selected category, not the whole root directory information, and all subcategories available in the database ..
This is what I get:
Books and Magazines:Amazon
Books and Magazines:Barnes and Noble
Computers: Buy.com
Computers: Outpost.com
This is what I want: (Remember only for the current category not all categories) So if I'm in Books and Magazines category below would be what I'd like to dislay for the subcategories.
Amazon
Barnes and Noble
Code:
# This one is automatic - requires javascript code in header of pages
###################################
sub hopto_subcategory{
###################################
$output = qq~
<form name="subcatform">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Browse Deals
<option value="">------------------------------- ~;
CATEGORY: foreach $cat (sort keys %category) {
# next CATEGORY if ($cat =~ /^\s*$/); # Shows Everything
# next unless ($cat =~ m,^([^/]*)$,); # Shows ONLY Main Categories
next if ($cat =~ m,^([^/]*)$,); # Shows ONLY Sub-Categories
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$build_root_url/$cat/">$title ~;
}
$output .= qq~</select></form>~;
return $output;
}
What I'd like to show is just the subcategory names for the CURRENTLY selected category, not the whole root directory information, and all subcategories available in the database ..
This is what I get:
Books and Magazines:Amazon
Books and Magazines:Barnes and Noble
Computers: Buy.com
Computers: Outpost.com
This is what I want: (Remember only for the current category not all categories) So if I'm in Books and Magazines category below would be what I'd like to dislay for the subcategories.
Amazon
Barnes and Noble
Code:
# This one is automatic - requires javascript code in header of pages
###################################
sub hopto_subcategory{
###################################
$output = qq~
<form name="subcatform">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Browse Deals
<option value="">------------------------------- ~;
CATEGORY: foreach $cat (sort keys %category) {
# next CATEGORY if ($cat =~ /^\s*$/); # Shows Everything
# next unless ($cat =~ m,^([^/]*)$,); # Shows ONLY Main Categories
next if ($cat =~ m,^([^/]*)$,); # Shows ONLY Sub-Categories
$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);
$output .= qq~<option value="$build_root_url/$cat/">$title ~;
}
$output .= qq~</select></form>~;
return $output;
}