[Zope-CMF] DTML trans to ZPT
Paul Winkler
pw_lists at slinkp.com
Thu Aug 14 03:54:01 EDT 2003
On Wed, Aug 13, 2003 at 05:02:32PM -0700, Eric Dunn wrote:
> I have a couple peices of code I'd like to use on my
> CMF site. Can anyone tell me how to translate them
> into ZPT?:
>
> <dtml-call "REQUEST.set('tracktable','hosts')">
> <dtml-call usercnt>
ZPT provides no equivalent to dtml-call. It's pretty common to use
a tal:define with a clearly-marked dummy variable, like so:
<div tal:omit-tag=""
tal:define="dummy python:request.set('tracktable', 'hosts');
dummy request/usercnt" />
... depending on where usercnt is (here? container? request?).
> and
>
> <dtml-with expr="MyCounter"> <dtml-var user_count>
> users online! </dtml-with>
ZPT doesn't need an equivalent to dtml-with, because you can easily
specify namespaces without it. Like so:
<div tal:replace="container/MyCounter/user_count" /> users online!
... but again, I don't really know where your MyCounter thing lives.
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE CHEESY HIPPIE!
(random hero from isometric.spaceninja.com)
More information about the Zope-CMF
mailing list