I currently have my root level cats displaying in 5 columns on my home page and want to be able to include this table on a number of other pages.
I know I can display a list of cats using a category list global like this:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','Name'] );
my $output="";
while (my ($root_cat,$full_name) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<li><a href="$CFG->{build_root_url}/$url/"><b>$full_name</b></a></li>~;
}
return $output;
}
But I am having trouble getting this to output a table with "build_category_columns" columns.
I have looked at site_html_print_cat to try and get some ideas, but not having much success. I know I could hard code a table and call it in, but my number of categories is expected to change quite a bit and its on the cards that I will be changing the number of columns now and again also, so I would rather this be all automated.
If anyone could help with this it would be appreciated
cheers
Mark
I know I can display a list of cats using a category list global like this:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','Name'] );
my $output="";
while (my ($root_cat,$full_name) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<li><a href="$CFG->{build_root_url}/$url/"><b>$full_name</b></a></li>~;
}
return $output;
}
But I am having trouble getting this to output a table with "build_category_columns" columns.
I have looked at site_html_print_cat to try and get some ideas, but not having much success. I know I could hard code a table and call it in, but my number of categories is expected to change quite a bit and its on the cards that I will be changing the number of columns now and again also, so I would rather this be all automated.
If anyone could help with this it would be appreciated
cheers
Mark