[Zope] Newbie - DTML if to ZPT if

fowlertrainer at anonym.hu fowlertrainer at anonym.hu
Fri Dec 5 02:59:26 EST 2003


Hello !

Sorry for lamer question.
I has been used DTML, and some things are don't know in ZPT.

How to I replace this DTML pseudo-code with ZPT:

1.)

=== DTML ===
<dtml-if logined=1>
 <table>SomeTable1</table>
<dtml-else>
 <table>SomeTable2</table>
</dtml-if>

==ZPT==
??????

2.)
How to define multiple (array) variable in zpt ?
Like this:

MyArray=[['A',1],['B',2],['C',3]]

3.)
How to I raise and catch exception with ZPT ?




In this time I use Scripts like this to replace dtml elements, but
this way is same as normal web-scripting (mod_php/py), not zope-kind.
==script1==
l=[]
if logined:
   l.append('<table>SomeTable1</table>')
   ...
else:
   l.append('<table>SomeTable2</table>')
   ...
return("\n".join(l))

... tal:replace structure python:here.script1>


Thanx for any advance.

-- 
Best regards,
 fowlertrainer                          mailto:fowlertrainer at anonym.hu




More information about the Zope mailing list