[Zope] How can I count the number of comments?

Laurie Nason lnason@bcm.tmc.edu
Tue, 26 Mar 2002 11:39:12 -0600


Hi Greg,
AFAIK you should be able to do the following and not bother with the name=
 of
the current sequence-item (the magic of acquisition - which I have a
love/hate relationship with [cf previous post about it!]):

<dtml-in expr=3D"News.objectValues()">
    <dtml-var sequence-item>
    <A HREF=3D"Comments/&dtml-id;/ListComments">
        <dtml-var expr=3D"_.len(objectValues(['DTML Document']))">
        Comments
    </A>
</dtml-in>

hth
Laurie
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Greg
Clough
Sent: Tuesday, March 26, 2002 11:29 AM
To: zope@zope.org
Subject: [Zope] How can I count the number of comments?


Hi,

I'm trying trying to loop over a group of news folders a,b,c and output a
count of the number of dtml documents (comments) in each.  I've got this =
far
(where ListComments is a dtml method that lists the comments):

<dtml-in expr=3D"News.objectValues()">
<dtml-var sequence-item>
<A HREF=3D"Comments/&dtml-id;/ListComments">
<dtml-var expr=3D"_.len(Comments.*****.objectValues())">
Comments
</A>
</dtml-in>

but I need to be able to replace the ***** with the current sequence-id
(i.e. a, b, or c) and I can't get it to work.

Can anyone help?
Greg




_________________________________________________________________
Join the world=92s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


_______________________________________________
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 )