Summary: Get pagelist to return a count of pages (deprecated)
Prerequisites: before 2.2.0-beta51
Status: Obsolete -- added to core in 2.2.0-beta51
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: 9144
Pages in the Cookbook group: 1791
Pages linking to Profiles.Pm: 723
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).
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!
There are 8981 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.