[Zope] Re: Options for Server Side Includes

Maik Jablonski maik.jablonski@uni-bielefeld.de
Wed, 19 Feb 2003 19:26:13 +0100


Edward Pollard wrote:
> As part of the process of migrating content from other web servers to
> Zope I'm faced with a bit of a puzzle in regards to handling the server
> side includes used on the old system.
> 
> I've found some comprehensive discussion on SSI with DTML, but we're
> only using Page Templates. I, of course, understand that tal:replace can
> be used, but I'm wondering if there are any other options. (Can't DTML
> be used in a Page Template? I thought I read that somewhere but it
> doesn't work...) The DTML examples are at least similar to our current
> usage.

You can include DTML into ZPT with something like:

  <span tal:replace="structure python:here.yourDTMLMethod(here, 
request)"></span>

> I'm concerned with the vast majority of our userbase who use server side
> includes, and if I can find a way to ease transition, well that would be
> spectacular. Anyone ever work on a problem like this?
> 
> (We are running a Netscape server at present, so the SSI is of the
> format <!--#include virtual=""-->. I wonder if there was some way to get
> Zope to recognize this format...)

You can create a "custom" <dtml-include>-tag... See

Zope/lib/python/DocumentTemplate

for coding your own DTML-tag.

-mj

-- 
German Zope User Group (DZUG) - http://www.dzug.org/