[Zope-dev] in 'singleton'

Andreas Kostyrka andreas@mtg.co.at
Sun, 29 Aug 1999 19:58:55 +0200 (CEST)


On Sun, 29 Aug 1999, Robin Becker wrote:

> it would be really useful to generalise <dtml-in var> to allow for the
> case when the variable is a singleton. I know I can write testing code
> for this, but it's a real pain to find that multiple selections change
> type when only one item is selected.
Well, what about, the following trick:
<dtml-unless "testvar[0:0]==[]">
<dtml-call "REQUEST.set('testvar',[testvar])">
</dtml-unless>

Andreas
--
Andreas Kostyrka                     | andreas@mtg.co.at
phone: +43/1/7070750                 | phone: +43/676/4091256   
MTG Handelsges.m.b.H.                | fax:   +43/1/7065299
Raiffeisenstr. 16/9                  | 2320 Zwoelfaxing AUSTRIA