Summary: Get pagelist to return a count of pages (deprecated)
Version: 2007-07-19
Prerequisites: before 2.2.0-beta51
Status: Obsolete -- added to core in 2.2.0-beta51
Maintainer: Pm
Categories: Obsolete

Questions answered by this recipe

  • How can I display the number of pages on my site, in a group, or matching some other criteria?

UPDATE: I have been informed by Pm that the features in this recipe have been included in PmWiki core starting with PmWiki version 2.2.0-beta51. This feature (fmt=count) is now documented in the fmt= section on the Page Lists page. Ian MacGregor.


The fplcount.phpΔ script adds a fmt=count option to (:pagelist:), returning a simple count of pages in the list. Here are some examples:

   Pages on the site:             (:pagelist list=all fmt=count:)
   Pages in the Cookbook group:   (:pagelist group=Cookbook fmt=count:)
   Pages linking to Profiles.Pm:  (:pagelist link=Profiles.Pm fmt=count:)
   Pages on the site:             10565
   Pages in the Cookbook group:   2312
   Pages linking to Profiles.Pm:  751


Add the following line to config.php



Note that the option is fmt=count without a '#', this differs from fmt=#count (with a '#') in that the latter refers to a pagelist template named "#count".


How to add more than one group? Or, better, how to list all groups minus PmWiki, Main, Site (default installation groups).

See Also



The recipe is enabled on this page -- feel free to experiment below.

There are (:pagelist list=normal fmt=count:) normal articles on this site.
(:if equal (:pagelist list=normal fmt=count:) "6307" :)
Hey it works!
(:if end:)

There are 10378 normal articles on this site.

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.