[Zope] I'm missing something really basic

Casey Duncan casey_duncan@yahoo.com
Wed, 6 Jun 2001 18:19:11 -0700 (PDT)


--- Chris Ryland <cpr@emsoftware.com> wrote:
> I've been using Zope for a couple of weeks now
> fairly intensely, and

That's the only way to do it 8^)

> learning fast. But then I run into the most obvious
> question in the world,
> and I'm stumped (perhaps it's too obvious). I've
> scoured the documentation,
> but I can't find it. So here goes.
> 
> How does a dtml document refer to the URL parameters
> passed to it?
> 
[snip]
>
http://localhost:8080/about/news?product=Xdata?newstype=review

This is not a legal URL to pass multiple CGI query
variables use (notice the ampersand):

http://foo:8080/bar?var1=val1&var2=val2

> 
> I can't for the life of me figure out how to get
> those two parameters. They
> don't seem to be in the context, and they're only in
> the REQUEST in the raw
> parameter string (which I guess I could parse).

These values get added to the REQUEST object, which
exposes them at the bottom of the namespace stack
(REQUEST is the last place checked for names). So, you
can either directly access them, or access them as
attributes or items of the REQUEST object.

for the above URL, the following lines would work:

<dtml-var name="var1">
&dtml-var1;
<dtml-var expr="REQUEST.var1">
<dtml-var expr="REQUEST['var1']">

The latter two are more explicit and would avoid
namespace collisions.

hth,

=====
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`----------------->

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/