How can I display category list of the same level by sending category ID,
I use this global but it work from categry.html and it work without send the ID of the category
sub {
my $args=shift;
my $db = $DB->table ('Category');
$db->select_options('ORDER BY Name');
my $sth = $db->select ( {FatherID=>$args->{FatherID}});
my @cats;
while (my $cat = $sth->fetchrow_hashref) {
unless ($cat->{ID} == $args->{ID}) {
if ($cat->{ID} == '1') { next; } #
$cat->{URL} = $CFG->{build_root_url} . '/' . $DB->table('Category')->as_url( $cat->{Full_Name} ) . '/' . $CFG->{build_index};
push @cats, $cat;
} }
return {more_cats_loop=>\@cats}
}
I use this global but it work from categry.html and it work without send the ID of the category
sub {
my $args=shift;
my $db = $DB->table ('Category');
$db->select_options('ORDER BY Name');
my $sth = $db->select ( {FatherID=>$args->{FatherID}});
my @cats;
while (my $cat = $sth->fetchrow_hashref) {
unless ($cat->{ID} == $args->{ID}) {
if ($cat->{ID} == '1') { next; } #
$cat->{URL} = $CFG->{build_root_url} . '/' . $DB->table('Category')->as_url( $cat->{Full_Name} ) . '/' . $CFG->{build_index};
push @cats, $cat;
} }
return {more_cats_loop=>\@cats}
}