[Zope] #include with DocumentTemplate?

Thomas B. Passin tpassin@mitretek.org
Thu, 3 May 2001 15:21:09 -0400


[Lance E Sloan]

> I'm writing some CGIs in Python and I borrowed the DocumentTemplate
> module from Zope because it does most of what I need.  However, there's
> one thing that it apparently doesn't do that I would really like.  And
> that would be to use "#include" tags to read in other DTML documents
> and parse them.  That is, tags like this:
>
> <!--#include name="header.dtml" -->
>
> Does DocumentTemplate already handle that?  I couldn't find it in the
> documentation.

 [Tom]

If you want to display ("render")  header_dtml, write

<dtml-var header_dtml>

If you want to call it (i.e., get it to do something that isn't intended to
display), write

<dtml-call header_dtml>

I don't see that there is really a need for an "include" as such since you
can incorporate other code as shown above.  Do you still think you need to
do it?

And stop using that obsolete syntax <!--#, even if it's still left over in
some documentation.

Cheers,

Tom P