[Zope] ZPT/TAL computed names?

J C Lawrence claw at kanga.nu
Thu Mar 4 17:53:43 EST 2004


How can I invoke a macro or a tal:replace where the macro or object name
has been dynamically computed at runtime?

eg:

  <tal block define = "name string:thing_${type}_${type}">
    <tal: replace = "structure here/${name}" />
  </tal:block>

  or

  <tal block define = "name string:macro_${type}_${type}">
    <div: metal:use-macro = "here/macro_file/${name}" />
  </tal:block>

I frequently find myself wanting to do pattern operations like this for
things like help texts, boilerplate, etc.

-- 
J C Lawrence
---------(*)                Satan, oscillate my metallic sonatas.
claw at kanga.nu               He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.



More information about the Zope mailing list