[Zope] How to assign a value to a dtml variable after it has been create
d with the let dtml tag ?
Bocquillon Philippe
Philippe.Bocquillon@trasys.be
Wed, 8 Aug 2001 17:57:31 +0200
Hello,
In the piece of DTML code here after, I'm trying to compare each element of
getAllPortalCategories() with each of getCategories().
I would like to have each element as a selected option in the generated HTML
if this element is in both lists.
Here the error I get is that Zope searches for a variable named 'false'.
I would want Zope considers 'false' as a string value assigned to
isSelected, not as a var to search.
But my problem is more general: how can I modify the value of a dtml
variable?
<tr>
<th align="LEFT" valign="TOP">Categories (current ones are
selected)</th>
</tr>
<td align="LEFT" valign="TOP">
<select multiple name="categories:list" size=10>
<dtml-in expr="getAllPortalCategories()">
<dtml-let aPortalCategory=sequence-item isSelected='false'>
<dtml-in expr="getCategories()">
<dtml-if expr="aPortalCategory == _['sequence-item']">
_['isSelected']='true'
</dtml-if>
</dtml-in>
<dtml-if expr="_[isSelected]=='true'">
<option selected> <dtml-var aPortalCategory> </option>
<dtml-else>
<option> <dtml-var aPortalCategory> </option>
</dtml-if>
</dtml-let>
</dtml-in>
</td>
Thanks in advance,
Philippe