[Zope] dtml-in help

Joel Burton joel@joelburton.com
Fri, 1 Mar 2002 09:48:19 -0500 (EST)


On Fri, 1 Mar 2002, Todd Loomis wrote:

> Hi All:
>
> I want to put a set <dtml-in> tag based on a select variable as such:
>
> <dtml-if "select=='All'">
> <dtml-in get_all_users>
> <dtml-else>
> <dtml-in get_select_users>
> </dtml-if>
>
> but I keep getting an error. Can I do this?
>
> Regards,
> Todd

Nope. But you can could have either two complete
dtml-in loops, with conditional dtml-ifs around them.

<dtml-if "select=='All'">
  <dtml-in>
    ..
  </dtml-in>
<dtml-else>
  <dtml-in>
    ..
  </dtml-in>
</dtml-else>


Or, probably better

<dtml-in "_.test(select=='All', get_all_users(), get_select_users())">
  ..
</dtml-in>


(I'm assuming that get_all_users and get_select_users are callable. If
not, ditch the parens.)

-- 

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant