I have a page template that <div> tag to insert another template. currently I do <div content="structure here/form.pt"> form template </div> I rely on the form.pt object to exist in the folder where the template is called from. This works okay. However, I think it would be wise to put some kind of error checking in the tal to avoid sending some kind of exception to the browser. what I think would be the correct thing is to test if form.pt exists, if not do insert nothing, otherwise insert it as above. However I can't seem to locate any tal syntax that lets me do this. I found tal:condition but haven't found any examples of using a 'exists' type of condition. Any pointers? -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing"
On 12.12.2006, at 22:57, David Bear wrote:
I have a page template that <div> tag to insert another template. currently I do
<div content="structure here/form.pt"> form template </div>
use the or operator it also catches errors
<div content="structure here/form.pt | nothing"> form template </div>
2006/12/12, David Bear <David.Bear@asu.edu>:
I have a page template that <div> tag to insert another template. currently I do
<div content="structure here/form.pt"> form template </div>
I rely on the form.pt object to exist in the folder where the template is called from. This works okay. However, I think it would be wise to put some kind of error checking in the tal to avoid sending some kind of exception to the browser.
what I think would be the correct thing is to test if form.pt exists, if not do insert nothing, otherwise insert it as above.
However I can't seem to locate any tal syntax that lets me do this.
I found tal:condition but haven't found any examples of using a 'exists' type of condition.
Any pointers?
There is an exists expression that you can use in a condition: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx#3-... -- Kit BLAKE · Infrae · http://infrae.com/ + 31 10 243 7051 Hoevestraat 10 · 3033 GC · Rotterdam + The Netherlands Contact = http://xri.net/=kitblake
participants (3)
-
Bernd Dorn -
David Bear -
kit BLAKE