Personal tools
You are here: Home Quills Blog Introducing PloneStatCounter

Introducing PloneStatCounter

by tim — last modified Jul 10, 2008 05:07 AM
Filed Under:

Off-topic (for a Quills blog), but I've written a small product to ease integration of a StatCounter page counter into Plone sites.

As part of the migration detailed in the previous post, I took the opportunity to write a small 'product' that makes it easy to integrate a StatCounter page counter into Plone sites. I had finally gotten sick of having to hack at main_template.pt in order to jam in the StatCounter code fragment. The result is Products.PloneStatCounter.

It provides an easy-to-use configlet for setting up the StatCounter project id and security code - as well as a couple of other slightly mysterious variables that appear to be required.

I made extensive use of Malthe Borch's tutorial on 'Adding configuration settings using Zope 3 schemas and formlib' and David Convent's tutorial on 'Customizing the viewlets in main_template'. As such, there is little of interest in a coding sense.

... Except for the fact that I found it necessary to avoid registering my viewlet in ZCML as I only wanted it to be used once the product itself had been installed in a portal_quickinstaller/GenericSetup sense. As such, I had to write the local viewlet registration code manually and have it run in my final GS import step.  philiKON was very helpful in pointing me in the right direction for how to do this, so thanks to him for saving me several hours of pain.

Document Actions