[ZPT] zpt 1.0 feedback
Guido van Rossum
guido@digicool.com
Mon, 09 Apr 2001 10:48:31 -0500
Thanks for your feedback!
> # zpt/zope with go live
>
> a. we tried using the webdav features of go live with zope but ran
> into some trouble. go live was not able to see or edit the raw PT
> source via webdav mode. either go live or zpt/zope would cause zope
> to render the document and then overwrite the PT source with the html
> output. i haven't spent enough time yet to investigate the exact
> source of the trouble. ftp mode was fine.
>
This is probably with Webdav to port 80 or 8080. Try port 90 or 9090,
the "source webdav" port. (May require Zope configuration.)
> but ran into the trouble of the handling of "." in the object names in
> zope and go live not understanding (for example) that "index_html" is
> really html. probably a pure zpt solution with standard suffixes
> (.html,etc.) might be fine. a design or style guide of good practices
> on using zope and go live together would be helpful.
>
> # zpt/zope
>
> a. html preview mode generates a URL (<name>/source.html) for browsing
> the html source. Due to the additional directory in the name path, we
> were having trouble with broken images. Part of my goal for using zpt
> is to allow for "demo" html to be equally viewable inside zope and
> outside as external files. I would prefer to minimize these issues.
>
> b. we were not able to render the following zpt templates:
>
> ------------------------------------------------------------------
> <html>
> <head>
> <title>tag test</title>
> </head>
> <body bgcolor="#FFFFEE">
> <table border="1" cellspacing="0" cellpadding="0" bgcolor="white">
> <tr>
> <td tal:content="string:<b>I WANT TO BE BOLD!!!</b>">DUMMY
> </td>
> </tr>
> </table>
> </body>
> </html>
> ------------------------------------------------------------------
>
> The above template is modifed and stored as the following document:
>
> ------------------------------------------------------------------
> <html>
> <head>
> <title>tag test</title>
> </head>
> <body bgcolor="#FFFFEE">
> <table border="1" cellspacing="0" cellpadding="0" bgcolor="white">
> <tr>
> <td tal:content="string:<b>I WANT TO BE BOLD!!!</b>">
> DUMMY
> </td>
> </tr>
> </table>
> </body>
> </html>
> ------------------------------------------------------------------
>
> Is this a feature or a limitation?
Try this:
<td tal:content="structure string:<b>I WANT TO BE BOLD!!!</b>">
^^^^^^^^^
> c. TALES: what is the policy for allowing (or disallowing) nested
> single and double quotes in a string TALES expression? I haven't
> checked yet, but I'm assuming the python TALES expression is identical
> to the python handling of nested quotes.
After the XML/HTML parser is through with the attribute, " and
' have been replaced with " and ', and then the *only* processing
done before the Python parser sees it is changing of double semicolons
to single ones, in those cases where a semicolon is meaningful to the
TAL parser (define and attributes).
So you can use only one type of quotes effectively in a python:
expression: the type of quote you *didn't* use for the TAL attribute.
> d. TAL: is possible to construct an else/elsif construct using the
> condition statement?
You'll have to use a second condition element with a not: expression.
> e. TALES: can you provide a few more examples describing the "here"
> Optional Name?
>
> f. TALES: i'm not clear on the meaning or usage of the "modules"
> Optional Name?
>
> g. TALES: the "request" Optional Name is available but what about
> "response"?
>
> i. It would be nice to be able to specify have a "default" TALES
> expression type for an entire PT document (or having some other ways
> of helping to remove some of the additional typing effort required by
> zpt).
>
> # simple demo program
>
> a. we put together a very simple color chart demo using zpt.
Thanks!
Note, I'll leave it to Evan to respond to the remaining questions.
--Guido van Rossum (home page: http://www.python.org/~guido/)