[Zope] Newbie - DTML if to ZPT if

Andreas Jung lists at andreas-jung.com
Fri Dec 5 03:04:22 EST 2003



--On Freitag, 5. Dezember 2003 8:59 Uhr +0100 fowlertrainer at anonym.hu wrote:

> 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>

see tal:condition  (there is no if-then-else in ZPT)

>
> ==ZPT==
> ??????
>
> 2.)
> How to define multiple (array) variable in zpt ?
> Like this:
>
> MyArray=[['A',1],['B',2],['C',3]]

same as in in python (see zpt reference)

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

checkout the "nothing" directive in ZPT 
(tal:condition="request/nonexisitingfield|nothing")

Your questions are pretty much covered by three ZPT chapters in the Zope 
Book.

-aj



More information about the Zope mailing list