[Zope] conditional dtml-in ?
Garry Steedman
gs@styrax.com
Wed, 7 Nov 2001 18:57:04 +0000
Michele,
you probably want to do something like this then (not that i'm saying
DTML is the best way to do it... ;-):
<dtml-call "REQUEST.set('results', [])">
<dtml-in "objectValues('Folder')">
<dtml-if "hasProperty('invisible') and invisible">
<dtml-call "results.append(_.getitem('sequence-item'))">
</dtml-if>
</dtml-in>
<dtml-in results>
<li><dtml-var title>
</dtml-in>
cheers,
Garry
On 7 Nov 2001, at 17:32, Ruberl Michele wrote:
From: Ruberl Michele <mruberl@etnoteam.it>
To: gs@styrax.com, zope@zope.org
Subject: RE: [Zope] conditional dtml-in ?
Date sent: Wed, 7 Nov 2001 17:32:23 +0100
> If I do
>
> <dtml-if expr=3D"my_attribute =3D=3D 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=3D"1", size=3D"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=EC 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=3D"objectValues('MyZClass')" where=3D"my_attribute =3D=3D 1"> D=
oes
> > > 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 )
+-------------------------------------------+
Garry Steedman mailto:gs@styrax.com
Styrax Associates http://www.styrax.com/
"The Good Man has no shape."
+-------------------------------------------+