[Zope] URL param string problem

Dieter Maurer dieter@handshake.de
Fri, 29 Mar 2002 13:16:59 +0100


Mark A. Lilly writes:
 > I have a DTML method which needs to concat a URL.
 > 
 > We have:
 > 
 > <dtml-with
 > expr="web_client('http://192.168.1.1/tinorb/pieex2.php?imageName=CA')">
 >   <dtml-var body>
 > </dtml-with>
 > 
 > There is a variable &dtml-theImageName; which needs to replace the CA in the
 > above code with the value of &dtml-theImageName; (which is equal to OH).
 > 
 > I tried doing something like
 > <dtml-let
 > theURL="_['http://192.168.1.1/tinorb/pieex2.php?imageName='+theImageName]">
 > 
 > But i get the following key error, which has the exact URL i want to pass to
 > web_client (see above) but it's not working.  Any thoughts??
 > 
 > Error Type: KeyError
 > Error Value: http://192.168.1.1/tinorb/pieex2.php?imageName=OH
Omit the "_[...]". It looks up "..." (your URL) and (of course) does
not find such a variable.

I.e., use:

      <dtml-let theURL="'http://192.168.1.1/tinorb/pieex2.php?imageName='+theImageName">

Note, that "url_quote_plus" may become necessary depending on the
value of "theImageName".


Dieter