[Zope] From ColdFusion to Zope: help with <dtml-if>?

Thomas B. Passin tpassin@mitretek.org
Thu, 19 Jul 2001 09:21:57 -0400


[Bob Campbell]

> I'm probably not explaining right, (certainly wouldn't be the first time).
> She is connecting through an ODBC connection and she can run a select *
and
> pull up all the links for the reports. The links are hardcoded in the db.
> When, for example, the Zope page is requested it runs the select all query
> and presents a list with dates and report name.(for 8 banks). That works
> fine....
> The the problem comes in when she has to ask if a link to a file is
> available (it may or may not be) if it is then put it up, if it isn't, put
> up the old file.
>

If the variable is known to exist but might be an empty string, you can test
with a <dtml-if>:

<dtml-if filevar>...</dtml-if>

If the variable might or might not exist,  you can look up how to check for
the existence of a variable that might be known to a dtml page.

If you need to check the file system to see if a named file is actually
there, you need to use Python (as others have said) or install the LocalFS
product (easy to do).  LocalFS knows how to access the file system for you.

Cheers,

Tom P