[Zope] python expression dtml-var rendering
Oleg Broytmann
Oleg Broytmann <phd@phd.pp.ru>
Fri, 11 Jan 2002 05:32:57 +0300
On Thu, Jan 10, 2002 at 03:01:59PM -0500, Trevor Toenjes wrote:
> Why do
> <dtml-var mycontent> and
> <dtml-var expr="subfolder.mycontent"> render differently?
>
> <dtml-var mycontent> displays intended without HTML tags. But,
> <dtml-var "subfolder.mycontent"> displays as if it is a text file.
>
> 'mycontent' is a DTML_Document.
Well, explanation. <dtml-var "xxx"> mens "evaluate python expression
xxx". And if the expression is just a DTML Document object - you'll get its
source.
To render a DTML object one must calls it: <dtml-var "xxx()">! In case
of <dtml-var xxx> DTML will automagically calls xxx()! This is called "DTML
Magic". :)
Oleg.
--
Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.