Gossamer Forum
Quote Reply
Show Cat Names In MOD
Hi,
So I implemented the show subcatlinks mod where I want to show all subcategory links on the category page.
Works great, thanks.

But, they show up all together. Is there a way to show something like this:

Category
link
link

Subcat name or desc
link
link

Other Subcat Name or desc
link
link

Doesnt have to get the name straight as subcat name, I can hard code it since all categories contain the same subcategories.

Current code Im using is:

sub {
my $output;
my $tags = shift;
return '' unless ($tags->{ShowSubCategoryLinks});
my $cat_id = $tags->{ID};
my $subcats = $DB->table('Category')->children($cat_id);
push @$subcats, $cat_id;
my $link_db = $DB->table('Links','CatLinks');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $subcats);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}


So with this code all links in all subcats show up without showing which subcat they belong to.
Any help would be apreciated.
Juan Carlos Gorospe
Subject Author Views Date
Thread Show Cat Names In MOD Gorospe 3332 Dec 4, 2005, 11:27 AM
Thread Re: [Gorospe] Show Cat Names In MOD
afinlr 3254 Dec 8, 2005, 4:47 PM
Thread Re: [afinlr] Show Cat Names In MOD
Gorospe 3253 Dec 9, 2005, 7:43 AM
Thread Re: [Gorospe] Show Cat Names In MOD
afinlr 3229 Dec 9, 2005, 8:48 AM
Post Re: [afinlr] Show Cat Names In MOD
Gorospe 3204 Dec 9, 2005, 8:51 AM