[Zope] Newbie: automatic template?

Brad Bollenbach brad@bbnet.ca
Tue, 18 Feb 2003 18:13:56 -0600


On 02/18/03 14:03, Bin Zhang wrote:
> I am new to Zope.  I  wonder if this is possible:
> 
> First create a folder and create a page template using either DTML or 
> ZPT, something like this:
> 
> <standard header>
> <standard navigation>
> Page content
> <standard footer>
> 
> 
> 2. page authors upload standard html files to the folder (via ftp or 
> webdav).
> 
> 3. When viewed from the browser, the template is automatically applied 
> to all uploaded files.
> 
> If this is possible, how can it be done?  Thanks for any pointers.

Presumably the part you're wanting to understand is how to dynamically
render the content in those HTML files (rather than, for example, how to
upload them into a Zope instance to begin with).

The answer is simple:

1. Write a Python script to return all objects of type "File" within the
current container.

2. Call that script from your template and plunk in the content from each.

For more, see the relevant chapter of the Zope Book:

http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx

HTH

-- 
Brad Bollenbach
Software Engineer
BBnet.ca