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="News.objectValues()"> <dtml-var sequence-item> <A HREF="Comments/&dtml-id;/ListComments"> <dtml-var expr="_.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 worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com
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="News.objectValues()"> <dtml-var sequence-item> <A HREF="Comments/&dtml-id;/ListComments"> <dtml-var expr="_.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="News.objectValues()"> <dtml-var sequence-item> <A HREF="Comments/&dtml-id;/ListComments"> <dtml-var expr="_.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 worlds 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 )
participants (2)
-
Greg Clough -
Laurie Nason