[Zope] #include with DocumentTemplate?

Lance E Sloan lsloan@umich.edu
Thu, 03 May 2001 13:11:04 -0400


I'm fairly new to Python and when I asked this question on a couple of
the python.org mailing lists, I was told I should probably ask here
instead.

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.

If it's not already built-in, is it possible to add such a tag?  I've
seen the examples on zope.org for adding tags to DocumentTemplate's
parser, but I don't know if its possible to get it to read a new file
and parse it in the middle of parsing another template.  Has anybody
already implemented this?

Thanks in advance.

--
Lance E Sloan
Web Services, Univ. of Michigan: Full-service Web and database design,
development, and hosting.  Specializing in Perl & Python CGIs.
http://websvcs.itd.umich.edu/ - "Putting U on the Web"