ZPT and traverse_subpath (Python Script)
Hi, is it possible to use traverse_subpath inside a python script, that is called by a ZPT ? I tried the following simple test. I call a PScript from a ZPT some extra path info. I expect the ZPT to replace "to be replaced" with a list containing the remaining path elements. But it's not working. Is this a bug or a feature ? :-) Viele Gruesse - Andreas ==== ZPT: ==== <html> <body> <p tal:content="here/pscript/ja/ja/deine/mutter"> to be replaced </p> </body> </html> ============= PythonScript: ============= ## Script (Python) "pscript" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # Example code: # Import a standard function, and get the HTML request and response objects. from Products.PythonScripts.standard import html_quote request = container.REQUEST RESPONSE = request.RESPONSE # Return a string identifying this script. return traverse_subpath -- ___________________________________________________________________________ Andreas Elvers | n@work Internet Informationssysteme GmbH Email: andreas@work.de | Tel./Fax: 040/23 88 09-00/29 | w w w . w o r k . d e
Andreas Elvers writes:
is it possible to use traverse_subpath inside a python script, that is called by a ZPT ? In this case, the ZPT needs to bind "traverse_subpath". Don't know whether it does. Is there a variable "traverse_subpath" in the ZPT defined? (work for you to find out)
If it is, then you pass this variable explicitly to your python script. If not, you need to wrap the ZPT call inside a Python Script. This catches "traverse_subpath", passes it explicitly to the ZPT which in turn passes it to the Python Script it calls. Dieter
participants (2)
-
Andreas Elvers -
Dieter Maurer