something like this??? <dtml-unless results> <dtml-call "REQUEST.set('results', [])"> <dtml-in get_clients sort=NOM> <dtml-call"results.append(_.getitem('sequence-item'))"> </dtml-in> </dtml-unless> g On 7 Nov 2001, at 8:39, Meilicke, Scott wrote: From: "Meilicke, Scott" <scott.meilicke@intp.com> To: "'Ruberl Michele'" <mruberl@etnoteam.it>, zope@zope.org Subject: RE: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 08:39:11 -0800
Can you build a list based on your conditional, then cycle through that list?
<dtml-in> <dtml-if expr="my_attribute == 1"> <code to make a new list> </dtml-if> </dtml-in>
<dtml-in new list> </dtml-in>
Does anyone have a code snippet to share to make a new list?
-Scott
-----Original Message----- From: Ruberl Michele [mailto:mruberl@etnoteam.it] Sent: Wednesday, November 07, 2001 8:32 AM To: gs@styrax.com; zope@zope.org Subject: RE: [Zope] conditional dtml-in ?
If I do
<dtml-if expr="my_attribute == 1"> <dtml-in> </dtml-in> </dtml-if>
my_attribute isn't an attribute of each sequence_item
If I do
<dtml-in> <dtml-if> </dtml-if> </dtml-in>
I cannot use the dtml-in modifiers, like start="1", size="10">... I mean, I can use them but I'd like them to mean "start from position 1 of the sequence of the items matching the where-like clause" and "take the first 10 elements of the sequence of the items matching the where-like clause". Am I wrong?
Michele
-----Original Message----- From: Garry Steedman [mailto:gs@styrax.com] Sent: mercoledì 7 novembre 2001 18.28 To: Ruberl Michele Cc: zope@zope.org Subject: Re: [Zope] conditional dtml-in ?
Michele,
am i missing something, why dont you do
<dtml-if> <dtml-in> </dtml-in> </dtml-if>
or some combination thereof???
cheers,
garry
On 7 Nov 2001, at 17:18, Ruberl Michele wrote:
From: Ruberl Michele <mruberl@etnoteam.it> To: "'zope@zope.org'" <zope@zope.org> Subject: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 17:18:03 +0100
Hi everybody,
is there a way of making <dtml-in> loops conditionally?
I would need something like <dtml-in expr="objectValues('MyZClass')" where="my_attribute == 1"> Does anybody have a method doing this or a way to help me?
Thanks a lot
Michele
_______________________________________________ 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 )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/
"The Good Man has no shape." +-------------------------------------------+
_______________________________________________ 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 )
_______________________________________________ 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 )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/ "The Good Man has no shape." +-------------------------------------------+