Attention

This document was written for an unsupported version of Plone, Plone 2.1.x, and was last updated 898 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Member List

by Ben Hussey last modified Dec 06, 2009 09:27 PM
I have modified a template that I found on the web to make it more suitable for a everyday plone site
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- Plone Member List Page Template
 Purpose: overview of all members, with quick access to member settings,
          and email address.
 Author: Russ Ferriday, russf@topia.com, http://topia.com, 2003.07.30
         Modified by Ben Hussey, benhussey@gmail.com 2006.03.07
         Based on an intial pt by ChaluKim - http://www.zopelabs.com/cookbook/1054517063
 Usage: Drop this into an internal folder accessible only to Managers.
 Tweaks: Change default_page_size to a smaller value if you want members in smaller/larger batches
 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
      lang="en-US"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="plone">

  <metal:block fill-slot="base">
      <tal:block tal:define="dummy python:request.set('disable_border', 1)"
                 tal:replace="nothing">
      Disable the tabs
      </tal:block>
  </metal:block>

<div metal:fill-slot="main"
     tal:define="is_manager python:test(here.portal_membership.getAuthenticatedMember().has_role('Reviewer'), 1, 0);">

  <div tal:condition="is_manager"
       tal:define="results python:here.portal_membership.searchForMembers(request);
                   Batch python:modules['Products.CMFPlone'].Batch;
                   DateTime python:modules['DateTime'].DateTime;
                   default_page_size python:1000;
                   page_size default_page_size;page_size request/psize | page_size;
                   b_size page_size; b_start python:0;b_start request/b_start | b_start;">

    <h1 i18n:translate="member_list">Member list</h1>

    <div tal:condition="results"
          tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1)">

        <strong>
        <span i18n:translate="batch_x_contacts">
          <span i18n:name="number" tal:content="python:len(results)">666</span> staff.
        </span>
        </strong>

        <br/>
         <span i18n:translate="more_than_shown" tal:condition="python:page_size < len(results)">
         Up to <span i18n:name="number" tal:content="page_size">666</span> members are summarized on each page.
         If you want all members on one page, click <a href="" tal:attributes="href python: '?psize:int=999999'">
                                            <strong><span tal:omit-tag="" i18n:translate="here_instead">here instead</span></strong>
                                        </a>. <br/>
         </span>
         <span i18n:translate="all_shown" tal:condition="python:page_size >= len(results)">
         All staff are shown. <br/>
         </span>
         <span i18n:translate="member_notes">
         To search, use Ctrl-F in your browser and make sure you are not case-sensitive search.<br/>
         You can click on the members name to edit their settings (if you have permission).<br/>
         You can click on an email address to send a mail to that staff member.<br/>
         </span>

        <!-- Navigation -->
        <div metal:use-macro="here/batch_macros/macros/navigation" />

        <table align='center'>
        <thead>
        <tr>
          <th i18n:translate="head_member_id">Login Name (FUll Name)</th>
          <th i18n:translate="head_email">Email</th>
        </tr>
        </thead>
        <tbody>

                <tal:block repeat="this_user batch">
          <tr tal:define="oddrow repeat/this_user/odd;
                          userid this_user/getUserId;
                                  fullname python: this_user.getProperty('fullname')"
              tal:attributes="class python:test(oddrow,'odd','even')">

                    <td>
              <a href="prefs_user_details"
             tal:attributes="href string:${here/portal_memberdata/absolute_url}/prefs_user_details?userid=$userid">
            <tal:block replace="structure portal/user.gif"/>&nbsp;<span tal:replace="this_user/getUserName">username</span>
            (<span tal:replace="fullname">Full Name</span>)
              </a>
                  <td><a tal:attributes="href string:mailto:${this_user/email}"><span tal:content="this_user/email">email</span></a></td>
               </tr>

          </tal:block>

        </tbody>
        </table>

        <br/>

        <!-- Navigation -->
        <div metal:use-macro="here/batch_macros/macros/navigation" />

    </div>

    <div tal:condition="not: results">
        <p><strong i18n:translate="description_no_results_found">No results were found.</strong></p>
    </div>

 </div>
 <div tal:condition="not: is_manager">
     <p><strong i18n:translate="members_unauthorized">You are not allowed to view this page.</strong></p>
 </div>

</div>

</html>

The page can only be viewed by reviewers and displays a list of users' login names, their full names and their email address


Add a new template and paste this in over the standard template it gives you - view the pag and all your members should be displayed.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.