J Cameron Cooper wrote:
I add a ErrCode variable to register.zpt. So in fact it redirects to "http://example.com/register.zpt?ErrCode=nouser". Now I want to add some HTML Code to the register.zpt with ZPT if ErrCode has the value "nouser". The problem is that ErrCode is not given in all cases. How can I do that? I suppose something with tal:condition but I don't really know how..
One way might be:
<span tal:condition="python:request['ErrCode']=='nouser'" tal:on-error="nothing">A!</span>
The span, of course, can be any tag, or go away with a tal:omit-tag.
Thats about that what I do. I first define assign a variable: tal:define="ErrCode REQUEST/ErrCode|string:'noerror'" And then test with: <font size="-1" color="red" tal:condition="python: ErrCode=='noname'">A!!</font> But the A! is always there, even if no ErrCode is provided. What's wrong? Thanks, Florian
You may want to check error types if you do anything more complex than checking a REQUEST parameter. Check the online help for details on that.