[Zope] <dtml-let> in and outside <dtml-in>

ghaley@mail.venaca.com ghaley@mail.venaca.com
Sat, 17 Mar 2001 18:10:24 -0500 (EST)


	Hi,

	Your use of dtml-let looks off.  My understanding of the let is
that it is sort of like a for loop, you initialize an iterator variable,
then use dtml-let to iterate through the list.  A dtml-let requires a
closing tag. 

<dtml-call "REQUEST.set('aa',[])">
<dtml-in something> // something must feature some sort of list which can
                    // be sequential records or a python list
  <dtml-let aa=sequence-index>
    <dtml-call "REQUEST.set('variable',value)">
  </dtml-let>
</dtml-in>

As for the other part of your question:  If you declare a varible or
assign a variable a value inside the dtml-in, it should exist outside the
dtml-in area.  

You might try this:

<dtml-call "REQUEST.set('done', 0)">
<dtml-if "stage == 3">
  <dtml-in . . .>
    <dtml-if . . .>
      <dtml-call "REQUEST.set('done',1)">
    </dtml-if>
  </dtml-in>
<dtml-else>
  <dtml-call "REQUEST.set('done',2)">
</dtml-if>

'done' is declared and initialized with a value of zero, if the conditions
inside your first if clauses hold true, done=1, if it does not, done is
set to 2.

ciao!
greg.

> <if stage=3>
>    <dtml-in...>
>      <dtml-if...>
>        <dtml-var bla>
>        <dtml-let done=1>
>      </dtml-if>
>    </dtml-in>
> </dtml-if>
> 
> <dtml-if not done or stage=2>
> ...
> </dtml-if>
> 


On Sat, 17 Mar 2001, Edwin Martin wrote:

> Hello,
> 
> I want to set a variable inside a <dtml-in>-loop and want to
> use it outside the <dtml-in>.
> 
> This is probably a FAQ, but I couldn't find the answer.
> 
> <dtml-let> wouldn't work and something like
> <dtml-call "REQUEST.set('done',1)"> doesn't work either.
> 
> I want to have something like this working (simplified):
> 
> Bye,
> Edwin Martin.
> 
> 
> _______________________________________________
> 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 )
> 
>