you can either add:
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":
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:
Philip
------------------
Limecat is not pleased.
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.