752 From: Jonathan <dev101@...109>
In your root folder you could have a script that accesses the ZCatalog which can >be called from any subfolder and can tell where it was called from... try the >following: create a python script (tst) in your root folder that contains the >following code:
return str(traverse_subpath)
then invoke this script file as followings:
http:/your.web.site/tst
http:/your.web.site/tst/folderA
http:/your.web.site/tst/folderB/folderC
(substitute your own subfolders as required)
You're going to be disappointed, but whenever I substituted in any number of valid folders, I got the same result: [] an empty set! TIA, Javier ____________________________________________________________________________________ Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
traverse_subpath works for me just fine. if you placed the 'tst' python script in your root folder (and this script contains the line "return str(traverse_subpath)" ) you should get: http:/your.web.site/tst -> should return an empty list [] http:/your.web.site/tst/folderA -> should return: ['folderA'] http:/your.web.site/tst/folderB/folderC -> should return ['folderB', 'folderC'] What version of zope are you running? (I am running zope 2.9.2 on a linux box). Jonathan ----- Original Message ----- From: Javier Subervi To: zope@zope.org Sent: Tuesday, December 12, 2006 1:16 PM Subject: [Zope] Re: Preserving Context 752 From: Jonathan <dev101@...109>
In your root folder you could have a script that accesses the ZCatalog which can >be called from any subfolder and can tell where it was called from... try the >following: create a python script (tst) in your root folder that contains the >following code:
return str(traverse_subpath)
then invoke this script file as followings:
http:/your.web.site/tst http:/your.web.site/tst/folderA http:/your.web.site/tst/folderB/folderC
(substitute your own subfolders as required)
You're going to be disappointed, but whenever I substituted in any number of valid folders, I got the same result: [] an empty set! TIA, Javier ------------------------------------------------------------------------------ Have a burning question? Go to Yahoo! Answers and get answers from real people who know. ------------------------------------------------------------------------------ _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
As far as I understand you have script (say it has id 'handle_404_scr') that handles 404 errors in 'root' folder. In this script you have something like: <div align="center" tal:define="mycontext here" tal:condition="here/hasSearchEngine(mycontext)"> Yes? So how is this script called? I'm not sure what exactly is your case but you may try: <div align="center" tal:condition="here/hasSearchEngine(here/aq_inner)"> or just (without passing a parameter): <div align="center" tal:condition="here/aq_inner/hasSearchEngine()"> -- Maciej Wisniowski
participants (3)
-
Javier Subervi -
Jonathan -
Maciej Wisniowski