[Zope] using url_quote outsite dtml-var

Chris Withers chrisw@nipltd.com
Mon, 30 Apr 2001 09:16:03 +0100


Joachim Schmitz wrote:
> 
> <dtml-call "REQUEST.set('link',BASE2 + '/' + _.url_quote(sometext)">
>                                              ^^^^^^^^^^^
>                                            that does not work

Write a python script, url_quote, taking one parameter, text:

from Products.PythonScripts.standard import url_quote
return url_quote(text)

Put that in the root and then, thanks to the magic of acquisition, you can use
it anywhere:

<dtml-call "REQUEST.set('link',BASE2 + '/' + url_quote(sometext)">

cheers,

Chris