[Zope] PARENTS[0] not working in dtml-in

Stefan Mallepell Stefan Mallepell" <steve@syso.ch
Mon, 16 Apr 2001 18:05:26 +0200


Hi 

Thank you!

I'm sorry for the HTML Email ... I was not on my own Maschine ...

Kind Regards
Stefan

----- Original Message ----- 
From: "Casey Duncan" <cduncan@kaivo.com>
To: "Stefan Mallepell" <steve@syso.ch>
Cc: <zope@zope.org>
Sent: Monday, April 16, 2001 5:12 PM
Subject: Re: [Zope] PARENTS[0] not working in dtml-in


> > Stefan Mallepell wrote:
> > 
> > Hi
> > 
> > Somehow my code isn't working like expected:
> > 
> > Without the 1st dtml-in loop the PARENTS[0].objectValues brings the
> > results as expected. If I add the 1st loop the results are wrong. They
> > are on level to low ...
> > 
> > Has anyone a idee how I can do this?
> > 
> > <dtml-in "objectValues(['kiscImageContainer'])" sort=ImgSequenceNo>
> > //1st
> > 
> >   <dtml-in "objectValues(['kiscImageDetail'])"> //2nd
> >     <dtml-if expr="ImgCoDefaultImageType==ImgDeImageType">
> > 
> >       <dtml-in "PARENTS[0].objectValues(['kiscImageDetail'])">
> >         do something
> >       </dtml-in>
> > 
> >       <dtml-var sequence-item>
> >     </dtml-if>
> >   </dtml-in>
> > 
> > </dtml-in>
> > Thanks for your help
> > Stefan
> 
> Are you expecting PARENTS[0] to always return the parent folder of the
> context? If so use:
> 
> aq_parent.objectValues[...]
> 
> otherwise use:
> 
> _.getitem('sequence-item').aq_parent.objectValues[...]
> 
> P.S. Please don't post HTML email to the list!
> 
> hth,
> -- 
> | Casey Duncan
> | Kaivo, Inc.
> | cduncan@kaivo.com
> `------------------>
>