i would *not* put both the tal:condition and metal:use-macro statements on a single tag. separate them so each is on its own tag:: <div tal:condition="python:request.form['id'] == 't' or nothing"> <metal:block use-macro="container/zptmac_memtask/macros/zptmac_taskslist"
List </metal:block> </div> jens On Tuesday, August 20, 2002, at 07:18 , zope wrote:
Hi All I am trying to execute a macro only if a condition is satisified. The code I am using is: <div tal:condition="python:request.form['id'] == 't' | nothing" metal:use-macro="container/zptmac_memtask/macros/zptmac_taskslist"> List </div> <div tal:condition="python:request.form['id'] == 'p' | nothing" metal:use-macro="container/zptmac_mempending/macros/zptmac_pendlist"> List </div> <div tal:condition="python:request.form['id'] == 'w' | nothing" metal:use-macro="container/zptmac_memweek/macros/zptmac_weeklist"> List </div> <div tal:condition="python:request.form['id'] == 'a' | nothing" metal:use-macro="container/zptmac_memall/macros/zptmac_alllist"> List </div> 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