[Zope] Checking for a boolean property value in DTML

complaw@hal-pc.org complaw@hal-pc.org
Fri, 15 Jun 2001 23:57:44 GMT


Okay, I moved all of this code into a DTML Method.  Note, the DTML Method itself
was called form a DTML Document.  One of things I want to do is list other DTML
documents that satsify a certain criteria in when someone wants to view the
first DTML Document.

Here is the code that works (in a DTML Method called from a DTML Document)...

<dtml-if expr="title == 'Mental Steps Doctrine'">
  Past first if<BR>
  <dtml-in expr="PARENTS[0].objectValeus('DTML DOcument')" sort="decision_date"
reverse>
    Past the in<BR>
    <dtml-if expr="document_type == 'case'">
      In the case.<BR>
      <a href="&dtml-absolute_url;"><dtml-var title></a><br>
    </dtml-if>
  </dtml-in>
</dtml-if>


Thanks to everyone who helped.

Ron


> I had tried that to.  It didn't work either.  Here is why...
> 
> I was running the code from an DTML Document, not a DTML Method.  
> 
> However, once I put the code in a DTML Method, it still didn't work.  I think
> that part of the problem is that the scope I'm working with by calling the
code
> from a DTML document, and then look for all of the DTML documents in the
folder,
> is misplaced.  What I may need is to call the parent object (a folder) to look
> for that bit of code...  Something like
> 
> <dtml-in expr="Parent.objectValeus('DTML DOcument')" sort="decision_date"
> reverse>
>   <dtml-if expr="document_type == 'case'">
>     Do something...
>   </dtml-if>
> </dtml-in>
> 
> Except that I don't have the parent parameter right.  I don't remember how to
> call a parent object.
> 
> Do you think that would solve the problem?
> 
> Ron
> 
> > 
> > 
> > > From: complaw@hal-pc.org
> > > Date: Fri, 15 Jun 2001 22:32:18 GMT
> > > To: Dieter Maurer <dieter@handshake.de>, complaw@hal-pc.org, zope@zope.org
> > > Subject: Re: [Zope] Checking for a boolean property value in DTML
> > > 
> > >> complaw@hal-pc.org writes:
> > >>> I have a boolean property in a DTML Document.  The boolean property is
> > > called 
> > >>> "mental_steps_doctrine".  I want to list those documents that have
> > >>> mental_steps_doctrine set to "TRUE"....
> > >>> <dtml-if expr="mental_steps_doctrine == 1">
> > >> Try:
> > >> <dtml-if mental_steps_doctrine>
> > > 
> > > I had tried that.  It didn't work (much to my surprise).
> > > 
> > 
> > Wouldn't that be a check if the variable itself exists?
> > 
> > I would think:
> > 
> > <dtml-if expr="mental_steps_doctrine">
> > 
> > 
> > 
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists - 
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> > 
> 
> 
>