[Checkins] SVN: Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt Test that variables are correctly added to the scope of the function that will return fill-slot content.

Malthe Borch mborch at gmail.com
Sat Nov 15 15:23:33 EST 2008


Log message for revision 92987:
  Test that variables are correctly added to the scope of the function that will return fill-slot content.

Changed:
  U   Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt

-=-
Modified: Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt
===================================================================
--- Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt	2008-11-15 19:56:16 UTC (rev 92986)
+++ Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt	2008-11-15 20:23:32 UTC (rev 92987)
@@ -42,9 +42,11 @@
   ...       xmlns:tal="http://xml.zope.org/namespaces/tal"
   ...       xmlns:metal="http://xml.zope.org/namespaces/metal"
   ...       metal:define-macro="master">
-  ...   <div metal:define-slot="content">
-  ...       I will be replaced
-  ...   </div>
+  ...     <tal:defines define="foo 'bar'">
+  ...       <div metal:define-slot="content">
+  ...          I will be replaced
+  ...       </div>
+  ...     </tal:defines>
   ... </html>""")
 
   >>> content = PageTemplate("""\
@@ -53,14 +55,14 @@
   ...      xmlns:metal="http://xml.zope.org/namespaces/metal"
   ...      metal:use-macro="main.macros['master']">
   ...   <div metal:fill-slot="content">
-  ...       I replace you.
+  ...       I replace you: ${foo}.
   ...   </div>
   ... </div>""")
 
   >>> print content(main=main)
   <html>
     <div>
-         I replace you.
+         I replace you: bar.
     </div>
   </html>  
   



More information about the Checkins mailing list