quick search:
 

count members

Submitted by: ChaluKim
Last Edited: 2003-06-05

Category: PageTemplates

Average rating is: 0.0 out of 5 (0 ratings)

Description:
Search portal membership
Count
Display all the emails
Show the count


Source (Text):
<span
 tal:define="results
              python:here.portal_membership.searchForMember(request);
             global count
              python:0;">
<span tal:repeat="user results">
<span tal:define="global count python: count + 1; "
      tal:content="python:user.email"/>,
</span>
<span tal:content="count">Total number of members</span>
</span>

Explanation:
This was ripped from the code to synchronize with mailing lists.

Note the use of global. Otherwise, you get 0.


Comments:

it does not work by khine - 2003-06-01
i've just ried it, and get 0 all the time
 
Re: it does not work by ChaluKim - 2003-06-01
put globa in front of count.
scope problem here.


searchForMembers by margarita - 2003-06-05
I think you must read "searchForMembers" instead of "searchForMember".