[Zope] nested logic in DTML

Chad McDaniel chadm@sgi.com
28 Jul 1999 14:51:18 -0700


I'm just getting to the point where I want to use DTML for fairly
deeply-nested logical structures.

Basically I have something like this:
---
<!--#call "bwProxy(REQUEST)"-->
<!--#if "REQUEST['bwProxySuccess'] == 'TRUE'" -->

  <!--#if "REQUEST.form.has_key('form_act')" -->

    <!--#if "form_act == 'Apply'"-->
      <!--#call updateStateSQL -->
      <!--#var successMessage -->
    <!--#else-->
      <!--#var changeStateForm-->
    <!--#/if-->

  <!--#else-->
    <!--#var changeStateForm-->
  <!--#/if-->

<!--#else-->
  <!--#var changeStateForm-->
<!--#/if-->
---

I'd like to add another fairly long conditional right before the
update line, but it makes things quite unwieldy. What I'd really like
would be a DTML Document like object that can return a value. I could
stick the long conditional in that object. Then I could reference the
object in several different places and just check the return value.

I realize that this is stretching DTML beyond it's presentation-only
design, but I do think that going all of the way to an external python 
method for this seems a bit much.

Any suggestions? 

thanks
-- 
-chad