[Zope] Page Content as a Form Variable

J Cameron Cooper jccooper@jcameroncooper.com
Tue, 25 Feb 2003 12:54:05 -0600


>
>
>#1) How exactly, in a DTML method in propertysheets/methods, can I get
>this out of an object? Normally I'd just call the filename, right? But
>when I'm in a method of its properysheet I can't really do that, I'm
>already is some sort of object-local namespace. I'm using <dtml-var
>document_src> to get the souce code.
>
>#2) There must be a convenient way of converting all those &lt/&gt etc
>back into "real code". What is it?
>
>I'll pick apart the ZMI in the meantime, but I'm certain someone out
>there has the answer in their brains already.
>  
>
So basically, you're asking how to round-trip content?

#1) you need to HTML quote your output, or it will, as you've seen, 
break the heck out of the textarea. In DTML you can say <dtml-var 
document_src html_quote> to do this. There are ways of going about it in 
ZPT and Python Scripts too.

#2) when you submit your form, this is taken care of. The HTML escape 
nonsense (&lt; et al.) is a source-only artifact, and what you see in 
the browser is what your code will see after submission. Unless you're 
having problems with this, in which case: creepy.

And your instinct to look to the ZMI is very good: it's a good place for 
examples.

       --jcc