[Zope] ZPT & passing around options...

matt matt@automagic.org
Tue, 10 Sep 2002 18:52:32 +1200


Can you clarify why you can't use 'context' instead of 'container' ?  It 
would seem you rely on acquisition in your site design, but throw it 
away in some of these methods.



Edward Muller wrote:

>Hello All...
>
>I have a problem that I haven't found a 'good' solution for.
>
>I use what I cann RPZN (Reverse Polish Zope Notation) when developing
>sites. RPZN is where you use one master template index_html in the root
>of your zope install. Thist master index_html file provides the layout
>for the entire site and includes (in my case) at least one reference
>like this:
><div tal:content="structure here/content" class="content">
>  Content
></div>
>
>This way each folder you create needs to only have a 'content' object
>(either a file, DTML Method or Document), which includes only the
>content for that folder. This makes adding to the site really easy. Want
>more content, add a folder, create a 'content' object and fill it in.
>The entire site look'n'feel is maintained in one place and that's
>/index_html.
>
>This has worked great for some time, until now. :-(
>
>Because of my design, in a Python script I need to call something like:
>  return container.content(variable1="sometxt", var2=["text1","text2"])
>
>This ends up calling the local content, without the surrounding site
>look'n'feel, <html> tags ... and the rest ... which is bad ...
>
>And ... calling index_html like so:
>  return container.index_html(variable1="sometxt",
>var2=["text1","text2"])
>(line may be wrapped)
>
>works fine wrt the site loook'n'feel and structure and all ... but the
>variables I pass into index_html get passed to the local content object,
>which is what I need to do.
>
>Anyone know how to do this? I spent some time looking around and I
>couldn't find an answer.
>
>Help! 
>
>Thanks in advance ... I'd be happy to clarify anything above if it
>helps.
>
>--EAM
>