[Zope] acquisition vs. inheritance

Chris Withers chrisw@nipltd.com
Fri, 04 Aug 2000 09:54:26 +0100


Jonothan Farr wrote:
> 
> > Is it possible to have just one top level object that refers to
> > other objects that get overridden as you go into other folders?
> 
> Acquisition works the other way around. You can create objects in subfolders
> whose contents are overriden higher up. You can't have an object at the top
> whose contents get overridden as you go down.

Urm, I think wires are getting crossed here, so here's an example which
may help (and which we use on most of our sites):

index_html is a DTML method:

<dtml-var standard_html_header>
<dtml-var index.html>
<dtml-var standard_html_footer>

Now, in each folder we have DTML documents called index.html which
actually contain the pages.

So, we have one index_html and many index.html's.

When someone does http://www.mysite.com/folder/
This actually renders http://www.mysite.com/folder/index_html
Then, index_html is acquired from the root.
However, because index.html exists is /folder, it is that which is
displayed.

I hope this makes it a little clearer :S

cheers,

Chris

PS:
> Your solution was correct. Create another index_html in the subfolder, 

As long as index_html is a method, you only need one of them, in the
root.

> which
> uses the 'contents' object in the subfolder, 

This will still happen if there's only one index_html