[Zope] Tal:condition problem

zope zope@stylusinc.net
Tue, 20 Aug 2002 16:48:31 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_001E_01C24869.6A747C20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All
I am trying to execute a macro only if a condition is satisified.
The code I am using is:

<div tal:condition=3D"python:request.form['id'] =3D=3D 't' | nothing"  =
metal:use-macro=3D"container/zptmac_memtask/macros/zptmac_taskslist">
      List
</div>
<div tal:condition=3D"python:request.form['id'] =3D=3D 'p' | nothing"  =
metal:use-macro=3D"container/zptmac_mempending/macros/zptmac_pendlist">
      List
</div>=20
<div tal:condition=3D"python:request.form['id'] =3D=3D 'w' | nothing"  =
metal:use-macro=3D"container/zptmac_memweek/macros/zptmac_weeklist">
      List
</div>=20
 <div tal:condition=3D"python:request.form['id'] =3D=3D 'a' | nothing"  =
metal:use-macro=3D"container/zptmac_memall/macros/zptmac_alllist">
      List
</div> =20
Depending on which value is passed with the form object i want that a =
particular macro be called.
But as soon as this page is rendered it shows me all the macros =
irrespective of whether I am sending any value for "id".
Is there some way I can check the condition and only show the required =
macro.
I m sure someone working on this particular area dealing with different =
conditions can help me out.

Best Regards

John Kunchandy




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002

------=_NextPart_000_001E_01C24869.6A747C20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi All</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I am trying to execute a macro only if =
a condition=20
is satisified.<BR>The code I am using is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;div =
tal:condition=3D"python:request.form['id'] =3D=3D=20
't' | nothing"&nbsp;=20
metal:use-macro=3D"container/zptmac_memtask/macros/zptmac_taskslist"&gt;<=
BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
List<BR>&lt;/div&gt;<BR>&lt;div =
tal:condition=3D"python:request.form['id'] =3D=3D 'p'=20
| nothing"&nbsp;=20
metal:use-macro=3D"container/zptmac_mempending/macros/zptmac_pendlist"&gt=
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
List<BR>&lt;/div&gt; <BR>&lt;div =
tal:condition=3D"python:request.form['id'] =3D=3D 'w'=20
| nothing"&nbsp;=20
metal:use-macro=3D"container/zptmac_memweek/macros/zptmac_weeklist"&gt;<B=
R>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
List<BR>&lt;/div&gt; <BR>&nbsp;&lt;div =
tal:condition=3D"python:request.form['id']=20
=3D=3D 'a' | nothing"&nbsp;=20
metal:use-macro=3D"container/zptmac_memall/macros/zptmac_alllist"&gt;<BR>=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
List<BR>&lt;/div&gt;&nbsp; <BR>Depending on which value is passed with =
the form=20
object i want that a particular macro be called.<BR>But as soon as this =
page is=20
rendered it shows me all the macros irrespective of whether I am sending =
any=20
value for "id".<BR>Is there some way I can check the condition and only =
show the=20
required macro.<BR>I m sure someone working on this particular area =
dealing with=20
different conditions can help me out.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>John Kunchandy<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by AVG =

anti-virus system (<A=20
href=3D"http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: =
6.0.381 /=20
Virus Database: 214 - Release Date: 8/2/2002</FONT></DIV></BODY></HTML>

------=_NextPart_000_001E_01C24869.6A747C20--