[Checkins] SVN: Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt Demonstrate nested scope variable redefinition issue in conjunction with passed in arguments.

Malthe Borch mborch at gmail.com
Sun Nov 16 07:31:21 EST 2008


Log message for revision 93007:
  Demonstrate nested scope variable redefinition issue in conjunction with passed in arguments.

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-16 12:30:45 UTC (rev 93006)
+++ Sandbox/malthe/chameleon.zpt/src/chameleon/zpt/template.txt	2008-11-16 12:31:20 UTC (rev 93007)
@@ -42,7 +42,7 @@
   ...       xmlns:tal="http://xml.zope.org/namespaces/tal"
   ...       xmlns:metal="http://xml.zope.org/namespaces/metal"
   ...       metal:define-macro="master">
-  ...     <metal:block tal:define="foo 'bar'">
+  ...     <metal:block tal:define="foo 'foo'">
   ...       Who are you, ${foo}?
   ...       <div metal:define-slot="content">
   ...          I will be replaced
@@ -56,15 +56,17 @@
   ...      xmlns:metal="http://xml.zope.org/namespaces/metal"
   ...      metal:use-macro="main.macros['master']">
   ...     <div metal:fill-slot="content">
-  ...         <tal:block i18n:domain="bar">I replace you: ${foo}.</tal:block>
+  ...         <tal:block tal:define="bar 'boo'" i18n:domain="bar">
+  ...           I replace you: ${foo} (${bar}).
+  ...         </tal:block>
   ...     </div>
   ... </div>""")
 
-  >>> print content(main=main)
+  >>> print content(main=main, bar='bar')
   <html>
-    Who are you, bar?
+    Who are you, foo?
     <div>
-       I replace you: bar.
+       I replace you: foo (boo).
     </div>
   </html>  
   



More information about the Checkins mailing list