[Zope] When Inheritance ISN'T Such A Good Idea...

Jim Kutter jim@ebizq.net
Mon Aug 4 12:24:48 EDT 2003


beno -=20

Our site makes heavy use of python scripts which are in the "root" of
the site to provide simple display URLs. These scripts make use of the
traverse_subpath variable to do this.

For example our site has the url
"/topics/<sometopic>/features/<feature_id>.html"
Topics is a pythonscript which reads the traverse_subpath list and based
on the url entered, returns a different display method. These display
methods are nested in a deep directory structure in zope to make
efficent use of acquisition. So going off the example, if only the
<sometopic> name is present; then the topics script returns=20
context.views.topics.details.body
Where <site root>/views/topics/details/body is either a zpt/dtml/python
script that produces the body of the page.
If the whole URL is present, the script returns
context.views.features.details.body
A whole different body method that displays features.

This may or may not help you, but I mention it here as an alternative
way of doing things.

-jim

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of beno
Sent: Saturday, August 02, 2003 1:15 AM
To: J Cameron Cooper
Cc: zope@zope.org
Subject: Re: [Zope] When Inheritance ISN'T Such A Good Idea...


At 11:26 AM 8/1/2003 -0500, you wrote:
>>Search engines don't like Web sites with deep directory structures. I
use=20
>>such structure to develop my Web sites to take advantage of
inheritance.=20
>>I keep all my Python scripts in a separate directory as well as the
basic=20
>>content of each page. This, of course, makes things neat and tidy in
my=20
>>Zope. So I don't want to simply throw everything in the root dir! Is=20
>>there a way to call scripts and Template Pages from other pages such
that=20
>>it renders as a simple URL without deep directories (e.g.,=20
>>http://mysite.com/main.html ) or frames?
>
>Just to be picky, it's acquisition rather than inheritance. Certainly=20
>they're similar concepts, but not quite the same.
>
>There is a beast called TransparentFolder that does what you describe:=20
>reverse acquisition.
>http://www.zope.org/Members/hathawsh/TransparentFolders
>
>It has some known performance consequences.
>
>If you really mean "call", then you can do things like=20
>"root.scripts.someScript". If you mean "link to", then I'm afraid that=20
>things in general live where they live.
>
>There are also things like PortableHole, MovedObject, References, et
al.=20
>(Also Redirector and Rewriter, which I never did get working.)

Thanks for the direction.
beno







More information about the Zope mailing list