[ZDP] Structured Text in Vars/DTML Methods

Martijn Pieters mj@antraciet.nl
Fri, 05 Mar 1999 13:02:52 +0100

Dear colleagae Zopista Archivarii,

When including Structured Text (ST) from a DTML Method into 
another Document with the fmt="structured-text" attribute, it will be
doubly quoted. This is because the __str__ method of the
DocumentTemplate.HTML class automaticly quotes it's HTML when called.

I have however found a workaround: By calling the ST document's read_raw()
method, you get the unquoted version.

This way we can use unquoted Structured Text examples in our FAQ:

<!--#var "ST_FAQ_Document.read_raw()" fmt="structured-text"-->

Of course, if the ST comes from a property, the read_raw() workaround is
not needed.

Can someone turn this into a FAQ entry? =)

PS, Pavlos, could your FAQ tool please use Structured Text? We need the
formatting, because otherwise all indentation is lost. I can't upload
Martijn Faassen's FAQ 0.1 right now, because all Python code in it will be
useless without the proper indentation.

M.J. Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149