[Zope] <dtml-if> question

TMGB bennettt@am.appstate.edu
Fri, 24 Sep 1999 16:26:10 -0400


I've tried searching the archives for <dtml-if> for an answer and with 
more than 500 results and subjects like 'Newbie question', 'problem', or 
just nothing at all, the first 50 did not even have <dtml-if> in them 
at all. I wonder if it did a search for '<dtml' and no 'if>' The 
results were at : 

http://www.egroups.com/search?type=mbox&query=%3cdtml-if%3e&listname=zope&start=26

Anyway, my question is, can I use <dtml-if> to compare a MySQL data 
value to a constant value such as (although these two haven't worked as
well as
other variations and combinations of these examples)

          <td><dtml-if <dtml-var add2faq>='Y'>
                 YES
              <dtml-else>
                 <form method="get" action="update_add2faq"><input
type="checkbox" name="pass_faq" value=<dtml-var ID>><input type="submit"
name="add2" value="YES"></form>
              </dtml-if>
          </td>

OR
          <td><dtml-if add2faq.value ='Y'>
                 YES
              <dtml-else>
                 <form method="get" action="update_add2faq"><input
type="checkbox" name="pass_faq" value=<dtml-var ID>><input type="submit"
name="add2" value="YES"></form>
              </dtml-if>
          </td>

The add2faq field is an enum of ('N','Y') in a MySQL table. And if I use 
<dtml-if add2faq> it is true for all values Y or N.

I've also looked at the documentation pages and didn't see any reference 
to using <dtml-if> outside of having just one variable argument.  Do I 
have to do a method that does an sql and then  returns one of two string
choices?

Thanx for any help you can give me.
Thoms


--------------------------------------------------------------------
                      Rock and Rule
             Zope Rocks -- http://www.zope.org
           Python Rules  -- http://www.python.org    
--------------------------------------------------------------------
Thomas McMillan Grant Bennett      Appalachian State University
Computer Consultant II             University Library
bennettt@am.appstate.edu          
http://www.library.appstate.edu/webmaster/
Voice:  828 262 6587	           FAX:    828 262 3001

Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit
operating system that was originally coded for a 4-bit microprocessor.
 - Chris Dunphy     Boot Magazine