Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [ryel01] link to link's category?: Edit Log

Here is the list of edits for this post
Re: [ryel01] link to link's category?
you can either add:

Code:

my $catdb = $DB->table('CatLinks', 'Category');
my $catsth = $catdb->select ({ 'CatLinks.LinkID' => $id}, ["Category.Full_Name"]);
$link->{category} = $catsth->fetchrow_array;

to the while loop...

Or create a new global called "category":

Code:
sub {
my $vars = shift;
my $id = $vars->{ID};

my $table = $DB->table('CatLinks', 'Category');
my $sth = $table->select ({ 'CatLinks.LinkID' => $id}, ["Category.Full_Name"]);
my $name = $sth->fetchrow_array;

return $name;
}

Then in your template you can do:

Code:
<a href="<%build_root_url%>/<%category%>/index.html"><%Title%></a>

Philip
------------------
Limecat is not pleased.

Last edited by:

fuzzy logic: Mar 18, 2004, 8:18 AM

Edit Log: