User list/directory using template files

Author Message

Quoc Huy Nguyen Dinh

Monday 04 August 2008 8:34:22 am

Hi all,

I'm trying to create a page that would list all users from a usergroup of ez publish.
I've been able to list names, and custom attributes with:
{def $user_members_node_id = 12

$list_items=fetch('content', 'list', hash( 'parent_node_id', $user_members_node_id,
'offset', $view_parameters.offset,
'class_filter_type', 'include',
'class_filter_array', array('user'),
'limit', $page_limit ) )

<ul class="item-list">
{foreach $list_items as $users}
{node_view_gui view=user_list content_node=$users}
{/foreach}
</ul>

Then in the node/view/user_list.tpl:
{attribute_view_gui attribute=$node.data_map.address_1}<br/>
etc...

But one thing I wanted but can't do is retreive the email address of that user.
The email field is not an attribute stored in ezcontentobject_attribute table but in the email field of ezuser.

Anyone has an idea how, from my tpl file, to retreive that email info from the ezuser table?

Thanks

Quoc Huy Nguyen Dinh

Monday 04 August 2008 9:34:27 am

Found the answer:
{section var=Attributes loop=$node.object.contentobject_attributes}
{if $Attributes.item.content.email|ne("")}
{$Attributes.item.content.email}
{/if}
{/section}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:34:36
Script start
Timing: Jan 18 2025 22:34:36
Module start 'layout'
Timing: Jan 18 2025 22:34:36
Module start 'content'
Timing: Jan 18 2025 22:34:37
Module end 'content'
Timing: Jan 18 2025 22:34:37
Script end

Main resources:

Total runtime1.2852 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.1797152.6406
Module start 'layout' 0.00630.0028 741.820339.4766
Module start 'content' 0.00911.2746 781.2969473.3828
Module end 'content' 1.28370.0014 1,254.67978.1250
Script end 1.2851  1,262.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2387160.0002
Check MTime0.00130.1002160.0001
Mysql Total
Database connection0.00110.083110.0011
Mysqli_queries1.233896.0045520.0237
Looping result0.00050.0362500.0000
Template Total1.256897.820.6284
Template load0.00200.159420.0010
Template processing1.254797.632820.6274
Template load and register function0.00020.012710.0002
states
state_id_array0.00060.050410.0006
state_identifier_array0.00140.105720.0007
Override
Cache load0.00170.1304330.0001
Sytem overhead
Fetch class attribute can translate value0.00100.078710.0010
Fetch class attribute name0.00160.122230.0005
XML
Image XML parsing0.00440.340010.0044
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00410.3167180.0002
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs