Gossamer Forum
Quote Reply
FatherID Issue
Displaying categories on the home page with this global. (Build directory for the cats is actually elsewhere)

The problem is with a FatherID => 0 shows the top level cats OK, but when wanting show those cats below the top level: FatherID => 1 nothing shows. Any ideas?

sub {
# lists categories
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options('ORDER BY Name ASC');
my $sth = $cat_db->select ( { FatherID => 1}, ['Full_Name','Name'] );
my @output;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{URL} = "$CFG->{build_root_url}/" . $cat_db->as_url($cat->{Full_Name}) . "/";
push @output, $cat;
}
return {cats_loop => \@output};
}

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: Dec 4, 2006, 11:31 AM
Quote Reply
Re: [Eraser] FatherID Issue In reply to
I see now. The father ID is actually 17!

In what circumstances would the fatherid change?

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] FatherID Issue In reply to
FatherID is the category ID of that category's father (except for categories in the root, which have a FatherID of 0).

Adrian