I am using latest Pyramid to build a web app. Somehow we have started using Chameleon as the template engine. I have used Mako before and it was extremely simple to create a base template. Is this possible with chameleon as well?
I have tried to look through the docs but I can not seem to find an easy solution.
Make a template here:
with contents:
Use the template here:
by inserting the contents:
Another option, which was used prior Chameleon got an ability to load templates from the filesystem, is to pass the "base" template as a parameter.
To simplify things, I often wrap such stuff into a "theme" object:
which can then be used like this:
Which then can be used in the template:
With Chameleon >= 2.7.0 you can use the "load" TALES expression. Example:
main.pt:
my_view.pt: