Kim Groves schrieb:

Is it possible to use the existence of a file on the webserver as a
condition in a TALES expression?

I have read many pages on Zope/TAL/TALES and they seem to indicate that it
is, however none of the offered syntaxes seem to operate correctly.

Here is the scenario:

We have a directory on the webserver: /information
which contains a set of pdf documents. The application is a cart, eg
The products on the site may or may not have an associated pdf file. The
name of the pdf is the same as the Product Id.
  <tr><td colspan=4><a target="" href="" tal:define="pdf_path
tal:condition="exists:pdf_path" tal:attributes="href pdf_path; target
pdf_path">Information Sheet</a></td></tr>

I would write something like:

<a tal:define="fname string:${product/pid}.pdf;
               folder here/information"
   tal:condition="exists: folder/?fname"
   tal:attributes="href folder/?fname/absolute_url"
  Information Sheet

(I don't understand why you want to have the url in target attribute).


ZPT mailing list

Reply via email to