Here is a global which I use to show category or categories below link
Hope that helps.
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}
Hope that helps.
Code:
sub { my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}