<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Give more info.&nbsp;&nbsp;Define qry_user_roles and qry_roles as part of your
<br>question.<br><br>Why are you using DTML?&nbsp;&nbsp;Its a *dying art*.&nbsp;&nbsp;I can hardly look at it<br>anymore :-)<br><br>DTML is depreciated in Zope (I think) and new people should go right to<br>Page Templates and Python Scripts (Im sure).
<br>Can you code this in a Python Script?<br><br>David<br><br><br></blockquote></div>qry_user_roles and qry_roles are two ZSQL methods that both contain data fields called 'role'. They both work fine on my pages apart from the nesting. One qry holds all possible roles in the system - the other one associates roles to users. I need the dtml-if to insert the word &quot;selected&quot; in a html drop-down box, so that the users role will be selected when the drop-down box displays:
<br><br>This will iterate over the roles and build the drop-down box:<br><br>&lt;select&gt;<br>&lt;dtml-in qry_roles&gt;<br>&lt;option&gt;&lt;dtml-var role&gt;&lt;/option&gt;<br>&lt;/dtml-in&gt;<br>&lt;/select&gt;<br><br>
This should display the proper value as well: <br><br>&lt;select&gt;<br>
&lt;dtml-in qry_roles prefix=&quot;outer&quot;&gt;<br>
&lt;option<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-in qry_users_roles&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-if expr=&quot;outer_role==role&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; selected<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/dtml-if&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/dtml-in&gt;<br><br>&gt;&lt;dtml-var role&gt;&lt;/option&gt;
<br>
&lt;/dtml-in&gt;<br>
&lt;/select&gt;<br><br>I'm 1 month into Zope now, so this is just what I've read from the Zope bible/ web etc. so far ...<br><br>Is dtml really dead?!? :-o<br>&nbsp;Shame - I like it.. Will read more about page templates then ;-)
<br>