I use this global to display category in the same level of the current category, this global work form the categoey.html, what changes I need to do so I call this category with the ID of the category - <%cat_list($catid)%> and it work?
sub {
my $args=shift;
my $db = $DB->table ('Category');
$db->select_options('ORDER BY Name DESC');
my $sth = $db->select ( {FatherID=>$args->{FatherID}});
my @cats;
while (my $cat = $sth->fetchrow_array) {
unless ($cat->{ID} == $args->{ID}) {
push @cats, $cat;
} }
return {more_cats_loop=>\@cats}
}
sub {
my $args=shift;
my $db = $DB->table ('Category');
$db->select_options('ORDER BY Name DESC');
my $sth = $db->select ( {FatherID=>$args->{FatherID}});
my @cats;
while (my $cat = $sth->fetchrow_array) {
unless ($cat->{ID} == $args->{ID}) {
push @cats, $cat;
} }
return {more_cats_loop=>\@cats}
}