[Zope] acquisition / dtml-with problem

Dieter Maurer dieter@handshake.de
Tue, 17 Apr 2001 22:33:02 +0200 (CEST)


Paul Winkler writes:
 > OK, I have a dtml document called "Foo".
 > This works fine when I view the document.
 > Now let's say this document is in the folder called FooFolder in
 > which there is a folder called SubFolder.
 > Now I can call Foo_dtml as either FooFolder/Foo_dtml,
 > or as FooFolder/SubFolder/Foo_dtml through the magic of
 > acquisition.
 > No problem so far, all is good.
 > 
 > Here's the problem. If I put this code in Foo_dtml:
 >  <dtml-with images>
 >  <dtml-var izea-sundial.jpeg>
 >  </dtml-with>
 > 
 > .... it works fine when called as FooFolder/Foo_dtml
 > but NOT when called as FooFolder/SubFolder/Foo_dtml .
 > WHen I do the latter, I get this:
 > 
 > Traceback (innermost last):
 > (SNIP)
 >   File
 > /home/pw/Downloads/Zope-2.2.2-src/lib/python/ZPublisher/Publish.py, 
 > 
 > /home/pw/Downloads/Zope-2.2.2-src/lib/python/DocumentTemplate/DT_With.py,
 > line 132, in render
 >     (Object: images)
 > AttributeError: (see above)
 > 
 > Why? It seems like dtml-with is unable to find my images
 > folder??
I tried to reproduce your problem (Zope CVS) but was unable.
Everything works as expected.

Are you sure that "Foo_dtml" is a DTML Document
(and not a DTML Method)?
If it would be a DTML Method, then it might find
an "images" in "Subfolder" which does not contain your
image.


Dieter