Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
Products
:
Gossamer Links
:
Discussions
:
Number of categories
Previous Thread
Next Thread
Print Thread
View Threaded
Sep 21, 2011, 7:19 AM
Z
User
(108 posts)
Sep 21, 2011, 7:19 AM
Post #1 of 4
Views: 4036
Shortcut
Number of categories
Is there a way to find the exact number of categories without manually counting them?
Thanks.
Sep 21, 2011, 7:32 AM
MJB
Enthusiast
(559 posts)
Sep 21, 2011, 7:32 AM
Post #2 of 4
Views: 3959
Shortcut
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)%>
Sep 21, 2011, 7:35 AM
MJB
Enthusiast
(559 posts)
Sep 21, 2011, 7:35 AM
Post #3 of 4
Views: 3958
Shortcut
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%>
Sep 21, 2011, 9:05 AM
Z
User
(108 posts)
Sep 21, 2011, 9:05 AM
Post #4 of 4
Views: 3952
Shortcut
Re: [MJB] Number of categories
In reply to
Thanks MJB, that worked.
Previous Thread
Next Thread
Print Thread
View Threaded