[Zope] Newbie - DTML if to ZPT if

Dragos Chirila d.chirila at bucarest.finsiel.ro
Fri Dec 5 03:05:11 EST 2003


Hi

1.
<table tal:condition="python:logined==1">SomeTable1</table>
<table tal:condition="python:logined!=1">SomeTable2</table>

2.
use tal:define (use global for globals variables)

dragos


----- Original Message ----- 
From: <fowlertrainer at anonym.hu>
To: <zope at zope.org>
Sent: Friday, December 05, 2003 9:59 AM
Subject: [Zope] Newbie - DTML if to ZPT if


> 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
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 




More information about the Zope mailing list