[ZPT] content type misbehavior

Dieter Maurer dieter@handshake.de
Mon, 22 Oct 2001 19:40:26 +0200 (CEST)


alan runyan writes:
 > * I have a PageTemplate that is my CSS (is this bad?) lets call it cmf.css
 > and when I change its content-type to text/css (in the PageTemplate Property
 > tab).. very weird things start to occur.
 > 
 > I will get TAL errors.  and once I got a ImportError when I tried to __goto
 > the folder in the ZMI where the offending PageTemplate was__
 > does the 'cooking' process happen when you visit that folder?
Apparently, it does.

At least it did in earlier ZPT versions...

 > would this be
 > fixed by Deiter's 'at-runtime' cooking patch?
Should be.

 > (has this patch been applied
 > to PageTemplates 1.4.1? -- it increased performance when dealing with
 > laodsof PageTemplates in 1.4)
Probably not.

  ZC is still very careful to apply submitted patches and
  this patch has not even been officially submitted.

But we should avoid the cooking in "setstate" before ZPT
is integrated in Zope 2.5. Parsing is incredibly inefficient
and we need to avoid unnecessary parsing as a high priority.
Otherwise, Zope slows down unacceptibly.

My patch is only one of the possibilities to achieve this.

 > ...
 > ... ZPT with content type "text/css" ...
 ZPT looks at the content type to determine whether is contains
 HTML or XML. In the latter case, it requires the "ParsedXML"
 product. I expect that this was the "ImportError" you have seen.
 

Dieter