Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Number of categories

Quote Reply
Number of categories
Is there a way to find the exact number of categories without manually counting them?

Thanks.
Quote Reply
Re: [Z] Number of categories In reply to
Andy's Ultra Global plug-in.

If you already have it installed you can get the category count with:

Code:
<%set categories_all = Plugins::ULTRAGlobals::Get_Totals('Category','all')%><%Plugins::ULTRAGlobals::Commify($categories_all)%>
Quote Reply
Re: [MJB] Number of categories In reply to
Alternatively you can use a separate global:

Title:
Code:
total_cats

Global:
Code:
sub { # show total number of categories (without commas - 123456)
my $cat_db = $DB->table ('Category');
my $count = $cat_db->total;
return $count;
}

Call it with:
Code:
<%total_cats%>
Quote Reply
Re: [MJB] Number of categories In reply to
Thanks MJB, that worked.