template-metal

how to use macros with pyramid / ZPT (Chameleon)

℡╲_俬逩灬. 提交于 2020-01-01 06:38:08
问题 I want to use macros with pyramid+ZPT engine (Chameleon). The docs say that "A single Page Template can accommodate multiple macros." http://chameleon.readthedocs.org/en/latest/reference.html#macros-metal Thus I defined a file macros.pt : <div metal:define-macro="step-0"> <p>This is step 0</p> </div> <div metal:define-macro="step-1"> <p>This is step 1</p> </div> and a global template main_template.pt with all the html stuff defining a slot content . and a template for my view progress.pt

How to use template inheritance with Chameleon?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-29 05:21:05
问题 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. 回答1: With Chameleon >= 2.7.0 you can use the "load" TALES expression. Example: main.pt: <html> <head> <div metal:define-slot="head"></div> </head> <body> <ul id="menu"> <li><a href=""

How to use template inheritance with Chameleon?

纵然是瞬间 提交于 2019-11-29 01:53:52
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. With Chameleon >= 2.7.0 you can use the "load" TALES expression. Example: main.pt: <html> <head> <div metal:define-slot="head"></div> </head> <body> <ul id="menu"> <li><a href="">Item 1</a></li> <li><a href="">Item 2</a></li> <li><a href="">Item 3</a></li> </ul> <div metal:define-slot=