RE: [Zope] When Inheritance ISN'T Such A Good Idea...
beno - 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 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 such structure to develop my Web sites to take advantage of inheritance. I keep all my Python scripts in a separate directory as well as the basic content of each page. This, of course, makes things neat and tidy in my Zope. So I don't want to simply throw everything in the root dir! Is there a way to call scripts and Template Pages from other pages such that it renders as a simple URL without deep directories (e.g., http://mysite.com/main.html ) or frames?
Just to be picky, it's acquisition rather than inheritance. Certainly they're similar concepts, but not quite the same.
There is a beast called TransparentFolder that does what you describe: 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 "root.scripts.someScript". If you mean "link to", then I'm afraid that things in general live where they live.
There are also things like PortableHole, MovedObject, References, et al. (Also Redirector and Rewriter, which I never did get working.)
Thanks for the direction. beno
participants (1)
-
Jim Kutter