[Zope] Newbie Acquisition Question

Casey Duncan cduncan@kaivo.com
Fri, 25 May 2001 09:55:14 -0600


Daniel Fairs wrote:
> 
> Hi,
> 
> I've just got a quick question on acquisition...
> 
> In my root folder, I have my index_html which contains, amongst other
> things:
> 
>     <td colspan="2">
>       <dtml-var contentPanel>
>     </td>
> 
> In the root folder, I have another DTML method called contentPanel, which is
> correctly displayed when I view the root folder.
> 
> Now, under the root folder, I have the following folder structure:
> /
> `SiteUsers/
>   `Dan/
> 
> SiteUsers is empty, except for Dan; Dan contains a single DTML Method called
> contentPane.
> 
> When I view localhost:8080/SiteUsers/Dan/ I would expect the contentPane
> from SiteUsers/Dan to be displayed (ie. index_html is being acquired by the
> Dan folder, but since there is a contentPanel in the Dan folder, that should
> 'override' the one in the root folder). However, I am getting the
> contentPane from the root folder. This is a namespace issue - how do I force
> Zope to use the correct namespace? My understanding was that all name
> resolution started at the place specified from the URL, and then worked back
> 'up' the tree... My experience here shows this is true, but the search URL
> always 'starts' from the object 'doing' the acquisition (index_html in this
> case) - hence the contentPane in Dan/ isn't being used.
> 
> How should I solve this?
> 
> Many thanks,
> Dan
> 

I suspect index_html in the root is a DTML document. Try making it a
DTML method. Documents alway execute in the context of their container,
methods in the context of their caller.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>