Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [jdgamble] count number of sub_categories

Quote Reply
Re: [jdgamble] count number of sub_categories In reply to
If you are looking for the number of subcategories within a category, not all the subcategories below, you can look at the $category_loop variable on that page. That is an array that contains each of the sub categories for that page (1st level subcats)

sub {
my @num_cats = @{$_[0]->{'category_loop'}};
return scalar @num_cats
}

just call it as <%num_subcats%> or whatever you named it.

If you are trying to find subcats as well, check out the Yahoo Subcats plugin for some example code.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread count number of sub_categories jdgamble 4839 Jan 12, 2005, 9:38 PM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4748 Jan 12, 2005, 10:20 PM
Thread Re: [pugdog] count number of sub_categories
jdgamble 4708 Jan 12, 2005, 11:42 PM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4717 Jan 13, 2005, 2:06 AM
Thread Re: [pugdog] count number of sub_categories
jdgamble 4713 Jan 13, 2005, 3:51 AM
Post Re: [jdgamble] count number of sub_categories
Andy 4702 Jan 13, 2005, 4:11 AM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4688 Jan 13, 2005, 10:55 AM
Post Re: [pugdog] count number of sub_categories
jdgamble 4663 Jan 20, 2005, 1:22 AM
Thread Re: [jdgamble] count number of sub_categories
VishalT 1181 Jan 16, 2024, 2:03 PM
Thread Re: [VishalT] count number of sub_categories
Andy 796 Mar 15, 2024, 1:37 AM
Post Re: [Andy] count number of sub_categories
VishalT 774 Mar 16, 2024, 12:15 PM