[Zope] Using ZPT to include a file

Simon Forster simon-lists@ldml.com
Wed, 18 Jun 2003 12:29:11 +0100

As you'll guess, I'm a complete beginner with Zope so I'll be asking 
some damn irritating questions - that's by way of an apology in advance 

I've waded through great chunks of the Zope Book so get some of the 
principles but of course I've forgotten as much as I remember because 
I've not applied any of it yet. FWIW, I'm reasonably confident that 
once I've got my head around Zope's way of working, things'll be OK but 
there's a whole host of new concepts being thrown at me.

While we're on FWIWs, the process of being introduced to Zope is quite 
a hairy one. As someone going through the learning procedure, my first 
call was to subscribe to this mailing list and to download the pdf 
version of the Zope Book. Generally, the mailing list talks about 
specific problems where I don't even understand the problem being 
addressed - but that's OK, part of the learning curve etc. Reading the 
Zope Book, quite quickly I got to examples that just didn't work. At 
this point I queried the list and was told that much of this had been 
fixed in a later Zope Book only available online.

Respectfully, archive the old versions of the book. The new book's 
structure is sufficiently different that you don't know what you've 
read and what you haven't - irritating if you're halfway through the 
previous version of the book. And people like me HATE starting again 
from the beginning! Archiving the old versions would seem to be quite 
low fruit in terms of preventing new users from starting off on the 
wrong foot!

Anyway, onto ?s. Firstly, a couple of generic ones:

- As a rule, I'm taking it that Zope Page Templates (ZPTs) are the way 
to go rather than DTML when we're talking about HTML pages? This broad 
rule seems to be the takeout from the latest Zope Book.

- As another rule, all logic goes into Python Scripts? Pages don't show 
logic unless it's presentation logic (if new user, display <b>Welcome 
New User</b> type of thing).

I just want to make sure that I start out with good habits.

A more specific ?:

I've got an existing site I'll adapt to run in Zope. This site has been 
put together in a very structured manner so should translate to Zope 
quite smoothly. Unfortunately, I'm failing at the first page. The 
structure of the site is such that I have a bunch of folders inside the 
sites root folder. One of these folders (Welcome) contains the default 
site page. What I'd like to do is include the content of this page in 
the index_html page at the site root. As Zope works back up the 
namespace hierarchy, the logical (to me) tag <b 
tal:replace="Welcome/index_html">Welcome to LDML Ltd</b> returns an 
error. How do I get Zope to include pages found in sub-folders?

Basic stuff but we've all got to start somewhere.


Simon Forster
   LDML Ltd, Office One, 16 Canham Road, London, W3 7SR, UK
         Tel: +44 (0)20 8749 7766     Fax: +44 (0)70 9230 5247