Re: [Zope] simple dtml-if question

2000-07-26 Thread Nick Garcia

joel grimes wrote:
 
 How do I do this?
 
 I have a table with a field called SerialNumber.  I want to test it for null
 and return a non-breaking space if it's null.
 
 Here's what I tried:
 
 dtml-if "SerialNumber = null"nbsp;
 dtml-elsedtml-var SerialNumber
 /dtml-if

dtml-var SerialNumber null="nbsp;"

-- 
Nick Garcia | [EMAIL PROTECTED]
CodeIt Computing | http://codeit.com

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Simple DTML-IN question

2000-07-19 Thread Andy McKay

Part of the problem here is that you cannot loop through a string (which is
what a DTML Document returns). You can split the string and loop through
that or more efficiently create a lines property on an object and loop
through that. Something like:

property: Course, type: lines

dtml-in Course
  dtml-let item=sequence-item
dtml-if "item[7] = '-'"
  
/dtml-if
 /dtml-let
/dtml-in

- Original Message -
From: "Terry Babbey" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 19, 2000 7:59 AM
Subject: [Zope] Simple DTML-IN question


 Everytime I think I am beginning to understand I try to do something
 new and wham! It won't work for me.
 I have a dtml-document that I have a list of courses for a college
 program. I would like to list the courses one item at a time checking
 the 8th character to see if it is a '-' so I know if the line is a
 comment or a course name. Here is the coding I have done so far and as
 usual it does not work so any help is appreciated.

 dtml-in "_.getitem(ProgCode + 'CL')"
 dtml-var sequence-item
 /dtml-in

 Terry

 --
 __
 Terry Babbey
 Technical Support Specialist
 Lambton College, Sarnia, Ontario, Canada
 __



 ___
 Zope maillist  -  [EMAIL PROTECTED]
 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 )



___
Zope maillist  -  [EMAIL PROTECTED]
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 )