Being so happy about having found a pure TWikiML solution (albeit by the help of the SpreadSheetPlugin) to
count BlogComments (see
Counting BlogComments (Redux) (20 Sep 2005)) I abandoned
this approach for (a) a more generic solution to count any TopicTypes, not only BlogComments, and (b) implemented it in the BlogPlugin using a new tag.
COUNTTOPICS boils down to a SEARCH with the parameters in place to do so. A format string lets you specify how to present the result and - if there's no hit - optionally depress any output at all. So if there
are no comments to an entry then there's no point in displaying a zero in
the header

. The same tag is used to seed the number attribute of the comment form when posting a comment. Bottomline,
- we solved a more general problem without much extra effort
- the BlogPlugin was cleaned up internaly to probide a
query interface
- the plugin solution is more flexible
- and faster
- we removed the SpreadSheetPlugin dependency (so far)
- but fattened up the "special purpose" plugin - the BlogPlugin which only exist to implement this blog application