I searched the forum and never found the code for this. I would like to count the number of sub categories on my category pages. If this global is in this forum, I could not find it...
I can figure out how to write it, but its time consuming...
Here is what I have...
sub {
#---------------------------------------------------
# Display the number of sub categories
my $tag = shift;
my $title = $tag->{title};
my ($db, $sth, $names);
my $count;
my $title = "Magic Directories/Dealers";
$db = $DB->table("Category");
$db->select_options("ORDER BY Name");
$sth = $db->select( ["Full_Name"] );
$names = $sth->fetchrow_array;
# run a loop and $count++;
# somehow cross reference the $title with the category names and count them...
return $name;
}
I haven't tested any of this, but I image it would be something close to this. It seems like a lot of work for something so simple...
Any ideas?
- Jonathan
I can figure out how to write it, but its time consuming...
Here is what I have...
Code:
sub {
#---------------------------------------------------
# Display the number of sub categories
my $tag = shift;
my $title = $tag->{title};
my ($db, $sth, $names);
my $count;
my $title = "Magic Directories/Dealers";
$db = $DB->table("Category");
$db->select_options("ORDER BY Name");
$sth = $db->select( ["Full_Name"] );
$names = $sth->fetchrow_array;
# run a loop and $count++;
# somehow cross reference the $title with the category names and count them...
return $name;
}
I haven't tested any of this, but I image it would be something close to this. It seems like a lot of work for something so simple...
Any ideas?
- Jonathan