> There's a Tracker linked from the main ZPT Wiki page.  You should be able to
> add it there.  On the other hand, I'd like to know how exactly you've tried
> to nest macros, and how it failed for you.
> 
> Cheers,
> 
> Evan @ digicool & 4-am
> 

Here is an examples:


ID: here/master

<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:define-macro="master">
   <head metal:define-macro="head">
     <title tal:content="here/title">sss title</title>
     <meta something="">
   </head>
   <body bgcolor="#9999ff" metal:define-macro="body">
     <div metal:define-macro="bodymacro">
       <h1>This is a macro 21</h1>
     </div>
     <div metal:define-slot="bodySlot">
       <h1>This is a H1 Header</h1>
     </div>
   </body>
</html>





Now notice this if I state use-macro for the METAL statement
in the HTML-tag, all subsequent metal:define-macro statements
gets replaced with the use-macro="here/master/macros/master>"

ID: here/Page1 (version1)

<html xmlns:tal="http://xml.zope.org/namespaces/tal" 
xmlns:metal="http://xml.zope.org/namespaces/metal">
   <head metal:use-macro="here/master/macros/head">
     <title tal:content="here/title">sss title</title>
     <meta something="">
   </head>
   <body bgcolor="#9999ff"
         metal:use-macro="here/master/macros/body">
     <div metal:use-macro="here/master/macros/body">
       <h1>This is a macro 21</h1>
     </div>
     <div metal:define-slot="bodySlot">
       <h1>This is a H1 Header</h1>
     </div>
   </body>
</html>


But if I instead apply the use-macro on the body and the head
this are working perfectly, subsequent define-macros in the inner
div gets turned in to use-macro="here/master/macros/body" though.

ID: here/Page1  (version2)

<html xmlns:tal="http://xml.zope.org/namespaces/tal" 
xmlns:metal="http://xml.zope.org/namespaces/metal">
   <head metal:use-macro="here/master/macros/head">
     <title tal:content="here/title">sss title</title>
     <meta something="">
   </head>
   <body bgcolor="#9999ff"
         metal:use-macro="here/master/macros/body">
     <div metal:use-macro="here/master/macros/body">
       <h1>This is a macro 21</h1>
     </div>
     <div metal:define-slot="bodySlot">
       <h1>This is a H1 Header</h1>
     </div>
   </body>
</html>

 
How I would want it to work is that if a higher level
of macro is set to use-macro the subsequent level 
would remain unchanged (e.g. as define-macro) until
I explicitly change it in to use-macro. 
I would then be able to set it to any macro definition,
e.g. use-macro="here/master/macros/bodymacro" or
use-macro="<some other path>/macros/<some other macro>" etc.

I think what would make allot of sense and that's probably how it 
supposed to work, right?

Best regards,
Johan Carlsson




_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to