Gossamer Forum
Quote Reply
Top categories global
I am using the top category global:

sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
my @root_cats = $cat_db->select (['Full_Name'], { FatherID => 0 })->fetchall_list;
my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<OPTION VALUE="$CFG->{build_root_url}/$url">$root_cat~;
}
return $output;
}



and I wanna change it to display the categories in alphabetical order which it does not currently..



Any suggestions?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Top categories global In reply to
Try:
Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options("ORDER BY Full_Name");
my @root_cats = $cat_db->select ('Full_Name', { FatherID => 0 })->fetchall_list();
my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<OPTION VALUE="$CFG->{build_root_url}/$url">$root_cat~;
}
return $output;
}

Adrian