tuesday_pt = ZopeTwoPageTemplateFile('tuesday.pt')

    def __call__(self):
        if self.isTuesday():
            return self.tuesday_pt()
        return self.index()

Thanks for this, it captures exactly what I wanted to do! It also means that the ZCML provides a clear picture of what the view actually provides, rather than providing meaningless 'disabled' views that cloud things over a bit.

Should anyone be googling this, you can save yourself 30 minutes or so by doing

from Products.Five.pagetemplatefile import ZopeTwoPageTemplateFile

rather than importing anything from the PageTemplate package itself.

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to