On Wed, Nov 21, 2001 at 08:04:35PM +0000, Dave Hodgkinson wrote:
> I might be totally missing something here, but i'd like to do
> something only if a file exists. Now, this kind of works:
>       
> [% TRY %]
> <TD VALIGN="TOP" WIDTH="100" bgcolor="#f0f0f0"> 
>    [% INCLUDE "$dir/nav.html" %] &nbsp; 
> </TD>
> [% CATCH %] 
> <!-- [% error.info %] -->
> [% END %]
> 
> 
> But the opening <TD> gets output anyway. Any ideas?

  [% TRY %]
     ....
  [% CATCH file %]    
     [% CLEAR %]      
  [% END %]

You might prefer to [% CATCH %] all errors and ignore them, but I 
prefer the above so that other errors in the template (e.g. syntax
errors) get reported and not silently ignored.

HTH

A



Reply via email to