Selectively enabling Chameleon page templates on Plone -


reading https://pypi.python.org/pypi/five.pt/2.2.1

  enable chameleon, configure package using zcml:     <include package="five.pt" /> 

are chameleon templates enabled per-package or globally? instructions little sparse.

if want enable chameleon particular package possible? (making migrating chameleon easier)

to quote directly pypi page package:

it works using monkey-patching onto existing api (specifically, talinterpreter , pagetemplate classes). in simple terms, patching replace tal interpreter class , make sure so-called "cooking" routine uses chameleon parser , compiler instead of zope.* reference implementation.

so, when load five.pt package, regular page templates code patched use chameleon templates instead when templates cooked (compiled).

that precludes enabling chameleon , disabling chameleon on package-by-package basis. once any packages uses <include package="five.pt" /> directive, five.pt configure.zcml file loaded , patch applied.

that said, theoretically should possible add per-package enabling or disabling patch; __call__ , cook methods of five.pt program utility have taught how detect package template applies , make decision on repeatdict class , page template object use.


Comments