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
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