[Zope] Count of all objects within a container

Tommy Johnson tommy@7x.com
Tue, 3 Jul 2001 13:23:59 -0800


Hey all,

I'm trying to get a count of all image objects within an images folder. The
basic idea is to be able to use this count within an HTML table so I can
format some rowspans. This bit of code will allow me to simply drop an image
in, and the code will take care of generating my navigation bar.

Here's the problem. I want a count of images in the Images_naviagtion
folder. By a manual count, I see 11. The code that I wrote is:

<dtml-with Images_navigation>
    <dtml-in objectValues>
        <dtml-var sequence-length>
    </dtml-in>
</dtml-with>

Now this gives me the correct answer of '11', but it gives it to me 11 times
as well (most likely because if the dtml-in statement). How do I get it to
just give me the correct answer ONCE?

Thanks in advance,
Tommy