Gossamer Forum
Home : Products : Links 2.0 : Customization :

Glennu's Category Menu Mod

Quote Reply
Glennu's Category Menu Mod
I am using Glennu's Category Menu Mod to put a pulldown navigation menu on the links pages, however, it does not show the subcategories, only the top categories. Does anyone know a fairly easy way to modify it so it will show the subcats as well? For example:

Category1

Subcategory1

Subcategory2

Category2

and so on.

I have changed it slightly for the jump to, but it is primarily the same. Here is the sub menu that I have in place:

Quote:


sub menu {
# --------------------------------------------------------
#
my (%c, @fields);
open (DB, "<$db_category_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
@fields = &split_decode ($_);
$c{$fields[$db_main_category]}++;
}
close DB;

$category_list .= qq|<form name="f1">\n|;
$category_list .= qq|<select name="Map" onChange="{\n|;
$category_list .= qq|for (var i=0; i < this.length; i++) {\n|;
$category_list .= qq|if (this.options.selected) {\n|;
$category_list .= qq|if (i!=0) {\n|;
$category_list .= qq|top.window.location=this.options.value;\n|;
$category_list .= qq|break;\n|;
$category_list .= qq|}\n|;
$category_list .= qq|}\n|;
$category_list .= qq|}\n|;
$category_list .= qq|}\n|;
$category_list .= qq|">\n|;
$category_list .= qq|<option selected value="#">Browse a Category:\n|;

foreach $field (sort keys %c) {
if ($field =~ m,^([^/]*)$,) {
$field2 = &build_clean($field);
$category_list .= qq|<option value= "$build_root_url/$field">$field2\n|;
}
}

$category_list .= qq|</select></select></form>\n|;
return $category_list;
}


Thanks in advance for the help.

Charlie