Gossamer Forum
Quote Reply
Drop Down Menu
I found this global on the board and it works wonderfully in Static mode.

Can someone help me to get this global to work in Dynamic and only show Top Level Categories?

In dynamic the drop down does show but does not go anywhere. No linking.

=========================================================================

sub {
my ($category,$output);
my $db = $DB->table('Category') || return $GT::SQL::error;
$db->select_options('ORDER BY Full_Name','LIMIT 100') || return $GT::SQL::error;
my $sth = $db->select( ['ID','Full_Name'] ) || return $GT::SQL::error;
$output .= qq|<select name="nnn-DeptSelect" onchange="top.location=this.options[this.selectedIndex].value" size="1">\n|;
$output .= qq|<option selected>Choose</option>\n|;

while (my ($id,$full_name) = $sth->fetchrow_array) {
my $safe_full = $full_name;
my @cut = split /\//, $full_name;

my $back = '';
for (my $i=0; $i < $#cut; $i++) {
$back .= q| |;
}
$back .= $cut[$#cut];
$output .= qq|<option value="$CFG->{build_root_url}/| . $db->as_url($safe_full) . qq|">$back</option>|. "\n";
}
$output .= "</select>\n";
return \$output;
}


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Subject Author Views Date
Thread Drop Down Menu SandraR 3891 Apr 24, 2006, 2:49 PM
Thread Re: [SandraR] Drop Down Menu
katabd 3817 Apr 24, 2006, 8:49 PM
Thread Re: [katabd] Drop Down Menu
SandraR 3823 Apr 25, 2006, 3:46 AM
Thread Re: [SandraR] Drop Down Menu
rascal 3804 Apr 25, 2006, 9:38 AM
Thread Re: [rascal] Drop Down Menu
SandraR 3810 Apr 25, 2006, 9:43 AM
Thread Re: [SandraR] Drop Down Menu
rascal 3792 Apr 25, 2006, 9:48 AM
Thread Re: [rascal] Drop Down Menu
SandraR 3795 Apr 25, 2006, 9:58 AM
Thread Re: [SandraR] Drop Down Menu
katabd 3789 Apr 25, 2006, 3:20 PM
Thread Re: [katabd] Drop Down Menu
SandraR 3766 Apr 25, 2006, 5:46 PM
Thread Re: [SandraR] Drop Down Menu
rascal 3762 Apr 25, 2006, 8:48 PM
Post Re: [rascal] Drop Down Menu
SandraR 3780 Apr 25, 2006, 9:03 PM