[Zope] Newbie DTML: How do you just declair a veriable.

Peter Sabaini sabaini@niil.at
Thu, 20 Apr 2000 14:06:46 +0200 (CEST)


not sure if i get you right. if you want to 

* include a string 'welcome' use
  
  <dtml-call "REQUEST.set('myvariable', 'welcome')">
  or
  <dtml-let myvariable="'welcome'">


* include the value of a variable named 'welcome' use

  <dtml-call "REQUEST.set('myvariable', welcome)">
  or 
  <dtml-let myvariable="welcome">

pretty much everything inside " quotes " is pythonic in DTML. you
might want to take a look at the DTML ref
(http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.html), esp.
the section "The expr attribute"

hth
peter.


On Wed, 19 Apr 2000, Coleman, Bryan wrote:

: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
:
:_______________________________________________
:Zope maillist  -  Zope@zope.org
:http://lists.zope.org/mailman/listinfo/zope
:**   No cross posts or HTML encoding!  **
:(Related lists - 
: http://lists.zope.org/mailman/listinfo/zope-announce
: http://lists.zope.org/mailman/listinfo/zope-dev )
:

-- 

_________________________________________________
peter sabaini, mailto: sabaini@niil.at
-------------------------------------------------