[Zope-dev] Rendering of objects in DTML

Bjorn Stabell bjorn@exoweb.net
Tue, 14 Jan 2003 11:01:42 +0800


> Bjorn Stabell wrote:
> > Hello,
> >=20
> > When a content is rendered by the Zpublisher, its index_html() is=20
> > called.  When it is rendered in DTML, e.g., as <dtml-var=20
> content>, its=20
> > __call__ method is called.  The __call__ method is also=20
> called if the=20
> > object appears in <dtml-if content> or <dtml-with content>.  Is it=20
> > possible to render these two cases differently from <dtml-var=20
> > content>?
>=20
> Which two cases?
> What do you mean by 'differently'?
>=20
> cheers,
>=20
> Chris

I would like

  <dtml-var content>
  <dtml-with content>...
  <dtml-if content>

to call different functions.  The first renders the object, the second
returns a mapping of the content's attributes/properties, the third
checks for "trueness" of the content.  Rendering a content could be an
expensive operation and I don't want to do it when doing dtml-with and
dtml-if.