[ZPT] Content/Presentation Separation

Isaac Levy isaac@structuredsystems.net
Thu, 25 Apr 2002 13:31:35 -0400


On Wednesday, April 24, 2002, at 08:51 AM, Call Me Audrey wrote:

> I still resent the idea of having to drop my python scripts into each 
> directory -- or even of having directories at all, aside from css, 
> macros, python, CONTENT, etc. Opinion, anybody?

One way of going about things,

You can use Zope to call a script (stored in a universal place), and 
apply it in the context of the directory.  All you need to do is call 
the object, (assuming it's accessable in a parent-folder path), and it 
can be applied in the context of where it is called.

This can very quickly get quite rich (and complex) if for instance, you 
start placing scripts of the same name, in different parts of the 
system, that do different things.  Then your templates, (called in the 
same way, assumably) can return different things to more generic tal 
statements as they traverse back through folders.  (Like a pachenko 
machine in 4d, but er, not random pathways.)

If that kind of Object structure is unnecessary in the context of what 
you are building, (i.e. having a seperate object somewhere on the system 
just makes it more confusing), I'd suggest then putting the python in 
the tal statement).

I tend towards structuring my content in organic nests, and then scaling 
through them with page templates calling python- but some of the other 
posts scale through with python, and pass things off, returning page 
templates.  Either way is great.

To me, it's all about making the simplest solution in the context of the 
problem to be solved.  No formula or strict method can apply.  Audrey, 
if you find a different way than what I describe, please post it!

Best,
.ike