Personal tools
You are here: Home Archives One Approach to Managing Users in Plone people_folder_listing
Document Actions

people_folder_listing

Page template customized from generic folder_listing to display the list of users, sorted by affiliation and last name. Dependencies: "person_types" lines property defined on folder calling template; getPeople python script

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      lang="en"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="plone">

<body>

    <div metal:fill-slot="main">
    <metal:main-macro define-macro="main">

        <div metal:use-macro="here/document_actions/macros/document_actions">
            Document actions (print, sendto etc)
        </div>

        <h1 tal:content="object_title" class="documentFirstHeading">
            Title or id
        </h1>

        <a href=""
           class="link-parent"
           tal:define="parent_url python:here.navigationParent(here, template_id)"
           tal:condition="parent_url"
           tal:attributes="href parent_url"
           i18n:translate="go_to_parent_url">
        Up one level
        </a>

        <p class="documentDescription"
           tal:content="here/Description"
           tal:condition="here/Description">
            Description
        </p>

        <metal:listingmacro define-macro="listing">
        <tal:foldercontents define="contentFilter contentFilter|request/contentFilter|nothing;
                            limit_display limit_display|request/limit_display|nothing;
                            more_url more_url|request/more_url|string:folder_contents;
                            contentsMethod python:test(here.portal_type=='Topic', here.queryCatalog, here.getFolderContents);
                            folderContents folderContents|python:contentsMethod(contentFilter);
                            use_view_action site_properties/typesUseViewActionInListings|python:();
                            over_limit python: limit_display and len(folderContents) > limit_display;
                            folderContents python: (over_limit and folderContents[:limit_display]) or folderContents;
                            show_about python:not isAnon or site_properties.allowAnonymousViewAbout">
        <tal:listing condition="folderContents">


<tal:personlist tal:define="people portal/getPeople">
<tal:categories tal:repeat="category here/person_types">
&nbsp;&nbsp;Quick Jump: <span class="discreet" tal:repeat="linkme here/person_types">|<a href="" tal:attributes="href string:#$linkme" tal:content="linkme">Category</a></span><span class="discreet">|</span><hr />
<a name="" tal:attributes="name category"><h3 tal:content="category">Category</h3></a>
<tal:person tal:repeat="person people">
<dl tal:condition="python: person['affiliation'] == category">
<dt>
<a tal:attributes="href person/id" tal:content="person/fullname">Name</a><span tal:condition="person/degree">, <span tal:content="person/degree" /></span><span tal:condition="person/workingtitle">, <span tal:content="person/workingtitle" /></span><span tal:condition="person/hometitle">; <span tal:content="person/hometitle" /></span><span tal:condition="person/homedepartment">, <span tal:content="person/homedepartment" /></span>
</dt>
<dd>
<span tal:condition="person/phone">tel: <span tal:replace="person/phone" /></span>
<span tal:condition="person/location">office: <span tal:replace="person/location" /></span>
<span tal:condition="person/keywords">keywords: <span tal:replace="person/keywords" /></span>
</dd>
</dl>
</tal:person>
</tal:categories>
</tal:personlist>

        </tal:listing>
        <metal:empty metal:define-slot="no_items_in_listing">
            <p class="discreet"
               tal:condition="not: folderContents"
               i18n:translate="description_no_items_in_folder">
                There are currently no items in this folder.
            </p>
        </metal:empty>

        </tal:foldercontents>
        </metal:listingmacro>
    </metal:main-macro>
    </div>

</body>
</html>

Thanks to the Davis Community Network for hosting this site.