modification pagetemplate.py for bug with collection for mediawiki