Hi,
This would require a bit of work to implement. Your basic steps are:
1. Add a new field to the Category table saying 'ShowSubcategoryLinks' that is set to either Yes or No.
2. Add a global called subcategory_links that is on the category.html template. It would look something like:
my $cat_id = $tags->{CategoryID};
return '' unless ($tags->{ShowCategoryLinks});
my @subcats = $DB->table('Category')->select ( FatherID => $cat_id )->fetchall_hashref;
my $output = '';
foreach my $subcat (@subcats) {
$output .= "$subcat->{Name}<br>";
my @links = $DB->table('Links', 'CatLinks')->select ( CategoryID => $subcat->{ID})->fetchall_hashref;
foreach my $link (@links) {
$output .= "$link->{Title}";
}
}
return $output
Obviously it needs better formatting to make it look how you want, but that's the general idea.
Cheers,
Alex
--
Gossamer Threads Inc.
This would require a bit of work to implement. Your basic steps are:
1. Add a new field to the Category table saying 'ShowSubcategoryLinks' that is set to either Yes or No.
2. Add a global called subcategory_links that is on the category.html template. It would look something like:
Code:
my $tags = shift; my $cat_id = $tags->{CategoryID};
return '' unless ($tags->{ShowCategoryLinks});
my @subcats = $DB->table('Category')->select ( FatherID => $cat_id )->fetchall_hashref;
my $output = '';
foreach my $subcat (@subcats) {
$output .= "$subcat->{Name}<br>";
my @links = $DB->table('Links', 'CatLinks')->select ( CategoryID => $subcat->{ID})->fetchall_hashref;
foreach my $link (@links) {
$output .= "$link->{Title}";
}
}
return $output
Obviously it needs better formatting to make it look how you want, but that's the general idea.
Cheers,
Alex
--
Gossamer Threads Inc.