开发者

Loading Macros from Other Template Files in Chameleon

开发者 https://www.devze.com 2023-03-26 15:53 出处:网络
I have a Pyramid app that uses 开发者_Go百科Chameleon for its templates. I would like to create a master template page (say master.pt) that contains several macros that I user throughout the pages of

I have a Pyramid app that uses 开发者_Go百科Chameleon for its templates.

I would like to create a master template page (say master.pt) that contains several macros that I user throughout the pages of my site.

I am trying to load these macros in different templates across my application, but I can't seem to do so - Chameleon's documentation indicates the following syntax:

<div tal:define="master load: ../master.pt" metal:use-macro="master" />

But this throws an exception. What is the correct syntax for including external macros in a Chameleon template?


In case anyone was wondering, since I am using Pyramid, the usage is a little different:
http://docs.pylonsproject.org/projects/pyramid/1.0/narr/templates.html#using-zpt-macros-in-pyramid

0

精彩评论

暂无评论...
验证码 换一张
取 消