[Zope] dtml acquisition

Andrew Altepeter aaltepet@bethel.edu
16 Jan 2003 10:40:20 -0600


Doh!

I answered my own question.  I have been struggling with this for a day
now, and I finally understand!

What was happening was that, whether it is a dtml method or document,
when called from within a python script, I needed to pass that dtml
object the scripts container object.  Then, to get to the
choose_template script from within the dtml object, I could just go:

<dtml-var expr="container.choose_template(params)">

Thanks for the help :-)


On Thu, 2003-01-16 at 10:28, Andrew Altepeter wrote:
> Hello All,
> 
> I'm fairly  new to zope, so please bear with me on this question.
> 
> I have a file, buried in:
> 
> /site/dir1/file1.html
> 
> This file calls a python script located in:
> 
> /site/ssi/choose_template
> 
> Which then calls:
> 
> /site/ssi/dir1/template_section_x(param1, param2, etc..)
> 
> With a few parameters.
> 
> If template_section_x is a python script, or a page template, zope
> acquisition works, and accessing the parameters works.
> 
> However, if template_section_x is either a dtml document or method,
> acquisition does NOT work, neither does accessing those parameters.
> 
> I have tried '<dtml-var choose_template>' to recursively load another
> template section, and zope complains that it can't find the object.
> 
> I have also tried '<dtml-var param1>' to access the parameters, and
> again zope complains that it doesn't know what I'm talking about.
> 
> I am convinced that this is some sort of acquisition problem, because if
> I call: /site/ssi/dir1/template_section_x directory from the web, the
> acquisition of /site/ssi/choose_template works just fine.
> 
> Do you have any suggestions about what I should try next, or an
> explanation of why this isn't working?
> 
> Thanks in advance for the help,
> Andy
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )