Re: [Zope] checking for elements in a list

2005-12-05 Thread Chris Withers
Christopher Rivard wrote: http://groups.yahoo.com/group/zope/message/150345 I'm working offline, so can't see what you're refering to. The solution that I have come to is to simply set a cookie and serve up the correct fields based on the cookie: dtml-if 17 in list_map_dir_id and 21 not in

Re: [Zope] checking for elements in a list

2005-12-05 Thread Chris Withers
J Cameron Cooper wrote: Just make sure that the elements of the list you're getting are what you think they are. If you ask about the integer 17 and the list actually has a string 17 they won't match. You can either adjust what you test or use something like the 'int' function to cast. Also

Re: [Zope] checking for elements in a list

2005-12-04 Thread Peter Bengtsson
On 12/4/05, J Cameron Cooper [EMAIL PROTECTED] wrote: Christopher Rivard wrote: Hello, I'm am trying to check for the membership of items in a list and think I'm missing something. How is this done in dtml? List allids: [15,16,17,18] Check for multiple items in the list:

Re: [Zope] checking for elements in a list

2005-12-04 Thread Christopher Rivard
Thanks Peter, The conditional within the dtml did the trick. This is a continuation of this issue (a bit cumbersome): http://groups.yahoo.com/group/zope/message/150345 The solution that I have come to is to simply set a cookie and serve up the correct fields based on the cookie: dtml-if 17

Re: [Zope] checking for elements in a list

2005-12-04 Thread Peter Bengtsson
I suggest you try a little scripting language called Python. You can use in inside Zope by creating Python Scripts (formal name: Script (Python)) Try to stay away from DTML as much as possible. It's only about as good as PHP alone. On 12/4/05, Christopher Rivard [EMAIL PROTECTED] wrote: Thanks

Re: [Zope] checking for elements in a list

2005-12-03 Thread J Cameron Cooper
Christopher Rivard wrote: Hello, I'm am trying to check for the membership of items in a list and think I'm missing something. How is this done in dtml? List allids: [15,16,17,18] Check for multiple items in the list: dtml-in allids prefix=loop dtml-if expr=loop_item == 17 something

[Zope] checking for elements in a list

2005-12-02 Thread Christopher Rivard
Hello, I'm am trying to check for the membership of items in a list and think I'm missing something. How is this done in dtml? List allids: [15,16,17,18] Check for multiple items in the list: dtml-in allids prefix=loop dtml-if expr=loop_item == 17 something dtml-elif expr=loop_item == 17

Re: [Zope] checking for elements in a list

2005-12-02 Thread Andreas Jung
You should definitely move such *complex* logic into a PythonScript. DTML is made for generating content but not to implement such complex logic...and of course the elif part won't work because that's the semantic of if-elif. -aj --On 2. Dezember 2005 05:37:17 -0700 Christopher Rivard [EMAIL