[Zope] More dtml-in sequenceing and cocatenation

Dieter Maurer dieter@handshake.de
Fri, 27 Jun 2003 19:58:05 +0200


hpinson@indepthl.com wrote at 2003-6-26 17:27 -0600:
 > I have a statment which outputs  a sequence of form checkbox string 
 > pairs, from a MySQL source:
 > 
 > <dtml-in SQL_getMath>
 > <input type="checkbox" name="dance_<dtml-var sequence-number>" 
 > value="1" 
 > <dtml-if expr="'math_' + _['sequence-number'] == 1">

This does not work, because "'math_' + ..." is a string and
is string is not equal to "1".

You probably want computed variable access:

    "_['math_' + _['sequence-number']] == 1"


A side note: learn about "dtml-in"s "prefix" attribute.
It makes your code more readable.


Dieter