[Zope] Newbie DTML: How do you just declair a veriable.
Coleman, Bryan
bcoleman@questcon.com
Wed, 19 Apr 2000 12:47:24 -0400
When I do that it sets the variable to a string that says welcome rather
that the dtml method named welcome. If I use <dtml-call
"REQUEST.set('myvariable','dtml-var welcome')"> it does nothing.
> -----Original Message-----
> From: Stephen Pitts [SMTP:smpitts@midsouth.rr.com]
> Sent: Wednesday, April 19, 2000 9:31 AM
> To: Coleman, Bryan
> Cc: 'zope@zope.org'
> Subject: Re: [Zope] Newbie DTML: How do you just declair a veriable.
>
> On Wed, Apr 19, 2000 at 11:03:21AM -0400, Coleman, Bryan wrote:
> >
> > I am sure that this has been asked before but for some reason I cant
> find
> > the answer.
> >
> > I am developing a small application and in part of it I want one page to
> > recursively call itself and display a new sub-page depending on which
> link
> > was clicked on. I am trying to just create a variable that I can set to
> the
> > new method but I always get an error.
> >
> > How do you just make an arbitrary variable.
> >
> > I tried <dtml-var somename> = <dtml-var somemethod> and it did not like
> that
> > complained about there not being a somename well that's what I am trying
> to
> > make.
> >
>
> The easiest way is to use REQUEST.set:
> <dtml-call "REQUEST.set('myvariable','myvalue')">
>
> Another way to do it is to use dtml-let. This is "cleaner" if you will
> only need the variable for a short time.
> <dtml-let nums="(4,5,6)">
> nums forward:
> <dtml-in nums><dtml-var sequence-item> </dtml-in>
> nums backward:
> <dtml-in nums reverse><dtml-var sequence-item> </dtml-in>
> </dtml-let>
>
> Nums only exists between the two <dtml-let statements>.
> --
> Stephen Pitts
> smpitts@midsouth.rr.com