Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [afinlr] Need help with Drop Down subcategory link list

Quote Reply
Re: [afinlr] Need help with Drop Down subcategory link list In reply to
This works! Thank you.



The reason I wanted the subcategory drop down list was that the subcategories for my categories actually are just a list of details about the category item. :)

Let's see if I took you code and made it to list aubcategories only would this work:

sub {
my ($all_ids,@list,$output);
my $tags = shift;

my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Name','Category.Full_Name'] );
while (my ($cat_id,$name,$full_name) = $sth->fetchrow_array) {
$all_ids = $DB->table('Category')->children($cat_id);
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC"); #Change this to change the order
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', \@$all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
push @list, $link;
}
foreach my $name (@list) {
my $detailed_url = "$CFG->{build_cgi_url}/$name";
$output .= qq~<option value="$detailed_url">$link->{'Full_Name'}~;
}
}
return $output;
}




Don't think this will work.... would it be foreach $cat_id instead?
Subject Author Views Date
Thread Need help with Drop Down subcategory link list tyranny 8299 Feb 23, 2003, 10:46 PM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8134 Feb 25, 2003, 5:46 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8186 Feb 25, 2003, 6:37 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8163 Feb 25, 2003, 6:46 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8147 Feb 25, 2003, 6:54 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8115 Feb 25, 2003, 7:15 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8119 Feb 25, 2003, 8:31 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8153 Feb 25, 2003, 8:50 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8175 Feb 25, 2003, 9:10 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8142 Feb 25, 2003, 9:49 AM
Post Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8122 Feb 25, 2003, 10:11 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7887 Nov 24, 2004, 8:02 AM
Thread Re: [ajiimd] Need help with Drop Down subcategory link list
afinlr 7858 Nov 24, 2004, 8:19 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7897 Nov 24, 2004, 10:28 AM
Thread Re: [ajiimd] Need help with Drop Down subcategory link list
afinlr 7799 Nov 24, 2004, 10:34 AM
Post Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7774 Nov 24, 2004, 11:56 AM
Post Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8169 Feb 25, 2003, 6:51 AM