neves wrote:
Moin moin, if you have a variable <%CertainCategoryID%> in your template your sub should look like
Code:
sub { my $tags = shift;
my $catid = $tags->{CertainCategoryID};
my $id = $tags->{ID};
my $db = $DB->table('CatLinks','Links');
my $cond = GT::SQL::Condition->new( 'CatLinks.CategoryID','=',$catid, 'CatLinks.LinkID','<>',$id);
$db->select_options("ORDER BY Hits DESC", "LIMIT 10");
my $rs = $db->select($cond,['Links.*'])->fetchall_hashref or return;
my $output ="";
foreach(@$rs){
$output .= Links::SiteHTML::display('link_detail',$_);
}
return $output;
}
Regards
Merten
Hi Merten,
thanks for your Help.
I dont have a variable <%CertainCategoryID%> because there is no linking to Category.
Is it possible to say:
sub {
my $tags = shift;
my $catid = $tags->{60};
....
....
To show only links from the Category with the ID 60 ??
Regards,
Frank