Hi, How do I do the following in ZPT please? <dtml-if "REQUEST.has_key('nofile')"> Please enter a file name by browsing your system </dtml-if> TIA Marie Robichon Web Task Force European Synchrotron Radiation Facility BP 220 38043 Grenoble Cedex France http://www.esrf.fr Tel: (33) 04 76 88 21 86 Fax: (33) 04 76 88 24 27
How do I do the following in ZPT please?
<dtml-if "REQUEST.has_key('nofile')"> Please enter a file name by browsing your system </dtml-if>
Try something like this: <span tal:omit-tag="" tal:condition="REQUEST/has_key('nofile')"> Please enter a filename by browsing your system. </span> The condition might need to be "python:REQUEST.has_key('nofile')". // mark -
At 10:50 08/08/02 -0500, you wrote:
How do I do the following in ZPT please?
<dtml-if "REQUEST.has_key('nofile')"> Please enter a file name by browsing your system </dtml-if>
Try something like this:
<span tal:omit-tag="" tal:condition="REQUEST/has_key('nofile')"> Please enter a filename by browsing your system. </span>
The condition might need to be "python:REQUEST.has_key('nofile')".
// mark -
Thanks for the quick reply but that doesn't work I get the following error. I am in fact trying to trap if I have done a RESPONSE.redirect (fileinput?nofile = 1) to the ZPT in which case I display the text otherwise the user just gets the file input box to fill in. Error Type: Undefined Error Value: REQUEST not found in "REQUEST/has_key('nofile')", at line 6, column 4 THX Marie
<<Thanks for the quick reply but that doesn't work I get the following error. I am in fact trying to trap if I have done a RESPONSE.redirect (fileinput?nofile = 1) to the ZPT in which case I display the text otherwise the user just gets the file input box to fill in.>> OK, this time I actually tried it. ;-) <span tal:condition="python:request.has_key('tree-s')"> tree-s found </span> I just picked tree-s because I saw it when I did this example: http://www.zope.org/Members/peterbe/DTML2ZPT/#example8 // m -
Mark McEahern writes:
How do I do the following in ZPT please?
<dtml-if "REQUEST.has_key('nofile')"> Please enter a file name by browsing your system </dtml-if>
Try something like this:
<span tal:omit-tag="" tal:condition="REQUEST/has_key('nofile')"> Correct is:
<span tal:condition="python: request.has_key('nofile')"> ... </span> Dieter
Dieter Maurer wrote:
Try something like this:
<span tal:omit-tag="" tal:condition="REQUEST/has_key('nofile')"> Correct is:
<span tal:condition="python: request.has_key('nofile')"> ... </span>
That's not the same ;-) Mark's example, if correct, would not include the span tag in the output... A neater short version which _does_ do what he want (probably ;-) would be: <tal:c condition="request/nofile"> ... </tal:c> cheers, Chris
participants (4)
-
Chris Withers -
Dieter Maurer -
Marie Robichon -
Mark McEahern