[ZPT] macros and contexts

Seb Bacon seb at jamkit.com
Fri Sep 12 14:18:23 EDT 2003


This is kind of difficult to explain, partly because I suspect I am 
trying to abuse macros.  I want to use macros to display objects other 
than the current context.  So, say I have a macro in a ZPT called widgetlib:

  <div metal:define-macro="widget_1_view">
    I am the widget 1 view on <span tal:replace="here/getId">some
    id or other</span>
  </div>

And I use it like this:

  <div metal:use-macro="here/widgetlib/macros/widget_1_view">
    Widget 1 view goes here
  </div>

How can I cause the above macro invocation to use a different value for 
'here'?  I want to do something like:

  <div metal:use-macro="here/objectA/widgetlib/macros/widget_1_view">
    Widget 1 view goes here
  </div>

And get an output like:

   I am the widget 1 view on objectA

Does that make sense?!

Cheers,

seb






More information about the ZPT mailing list