Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Displaying Multiple Categories for a Link

Quote Reply
Displaying Multiple Categories for a Link
I'm trying to display a link to all the categories in which a link is listed.

I used the following global but it only displays a single category:

sub {
my $tag = shift;
my $table = $DB->table ('CatLinks');
my $sth = $table->select ( { LinkID => $tag->{ID} }, ['CategoryID'] );
my $catID = $sth->fetchrow();
my $cattable = $DB->table('Category');
my $sth2 = $cattable->select ( { ID => $catID }, ['Full_Name'] );
my $name = $sth2->fetchrow_array;
my $clean_name = $cattable->as_url($name);
my $url = "<a href=\"" . $CFG->{build_root_url} . "/" . $clean_name . '/' . $CFG->{build_index} . "\">" . $name . "</a>";
return $url;
}


Is there a way to modify this or loop this code to display multiple categories?

Thanks.
Subject Author Views Date
Thread Displaying Multiple Categories for a Link biglion 2226 Aug 23, 2007, 1:51 PM
Thread Re: [biglion] Displaying Multiple Categories for a Link
Andy 2176 Aug 24, 2007, 1:55 AM
Thread Re: [Andy] Displaying Multiple Categories for a Link
biglion 2177 Aug 24, 2007, 7:59 AM
Thread Re: [biglion] Displaying Multiple Categories for a Link
Andy 2168 Aug 24, 2007, 8:09 AM
Thread Re: [Andy] Displaying Multiple Categories for a Link
biglion 2145 Aug 24, 2007, 8:37 AM
Thread Re: [biglion] Displaying Multiple Categories for a Link
Andy 2162 Aug 24, 2007, 8:55 AM
Post Re: [Andy] Displaying Multiple Categories for a Link
biglion 2162 Aug 24, 2007, 9:01 AM