This is my site map code. You'll need to fiddle with it to get it looking how you want. It shows the first two levels of subcategories.
sub {
# -------------------------------------------------------------------
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','ID','Name'] );
my $output=qq~<table><tr valign=top><td width="25%"><table>~;
my $i=0;
while (my ($root_cat,$ID,$heading) = $sth->fetchrow_array) {
$i++;
my $url1 = $cat_db->as_url($root_cat);
$output.= qq~<tr><td colspan=2><font size=-1><b><a href="$CFG->{build_root_url}/$url1" class="toc">$heading</a></b></font></td></tr>~;
$cat_db->select_options ('ORDER BY Full_Name');
my $sth2 = $cat_db->select ( { FatherID => $ID}, ['Full_Name','ID','Name'] );
while (my ($cat,$id,$heading1) = $sth2->fetchrow_array) {
# my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id});
my $url = $cat_db->as_url($cat);
$output .= qq~<tr><td> </td><td><font size=-2><a href="$CFG->{build_root_url}/$url" class="toc">$heading1</a></font></td></tr>~;
$cat_db->select_options ('ORDER BY Full_Name');
my $sth3 = $cat_db->select ( { FatherID => $id}, ['Full_Name','ID','Name'] );
while (my ($cat2,$id2,$heading2) = $sth3->fetchrow_array) {
# my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id2});
my $url2 = $cat_db->as_url($cat2);
$output .= qq~<tr><td> </td><td><font size=-2>- <a href="$CFG->{build_root_url}/$url2" class="toc">$heading2</a></font></td></tr>~;
}
}
if (($i eq '13')or ($i eq '19') or ($i eq '33') or ($i eq '40')){ $output.=qq~</table></td><td width="25%"><table align=top>~;}
}
$output.="</table></td></tr></table>";
return $output;
}
Laura.
The UK High Street