Forums / Setup & design / How to access user attributes

How to access user attributes

Author Message

Pascal France

Wednesday 17 May 2006 6:13:21 am

Hi,

when I display the user attributes table with {$user1|attribute(show)} I can see:

contentobject 	           object[ezcontentobject] 	Object
>id 	                          string 	                          10
>section_id 	             string 	                             2
>owner_id 	             string 	                            14
>contentclass_id 	 string 	                        4
>name 	                     string 	                             'Anonymous User'
>is_published 	           string 	                           0
>published 	            string 	                            1033920665
>modified 	            string 	                             1072180405
and so on....
groups 	                       array 	                              Array(2)
>0 	                         string 	                        42
>1 	                         string 	                        4

I can access contentobject attributes but I don't know how to access "groups" strings.

Cordially

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Łukasz Serwatka

Wednesday 17 May 2006 11:27:29 pm

groups is an array so you can use {$user1.groups.0} for the first element. or loop

{foreach $user1.groups as $group}
    {$group}
{/foreach}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog