[Zope] Building a list programmatically under DTML

Evan Simpson evan@4-am.com
Mon, 06 Sep 1999 21:29:36 -0500


Timothy Grant wrote:

>   <dtml-var expr="_[Category]">
>   <dtml-if "_[Category][0:2] <> 'No'">
>     <dtml-call "REQUEST.set('desc[&dtml-idx;]', _[Category])">
>     <dtml-call "REQUEST.set('desc_qty[&dtml-idx;]', qty)">
>     <dtml-call "REQUEST.set('idx', idx + 1)">
>   </dtml-if>

should be:

<dtml-if "_[Category][:2] <> 'No'">
  <dtml-call "REQUEST.set('desc[idx]', _[Category])">
  <dtml-call "REQUEST.set('desc_qty[idx]', qty)">
  <dtml-call "REQUEST.set('idx', idx + 1)">
</dtml-if>

Assuming that Category contains an Id, and not the string you are trying
to examine and store, that is.  If Category is the string, leave off the
'_[]'s.