Get information from user object

Hi guys, 

I'm using: elgg_list_entities_from_relationship($options);

I get all entities I want just listed...but if I want to customize the way they look, for example get only Icon, name and the city he lives, how can I do?

I'm trying to use elgg_get_entities_from_relationship($options); that give me the user data, but how can I get others information about the user? For example the city?

Thanks

  • do they have the city saved as a profile field? (You can't get things that don't exist).

    elgg_get_entities_from_relationship(array()); is a good place to start. Then you would run a foreach($objects as $object){} call, and echo whatever you want in there.

    If the other information is saved as metadata then you would simply echo $object->city;

  • Thanks Trajan,

    that's right! but what about the profile icon? is there a profile field? I can't find it in the mod/profile/start.php

    How can I get the icon or the url?

     

  • I've solved with a simple: 

    elgg_view('profile/icon', array('entity' => $entity,'size' => tiny,'override' => true));

    ;)

  • yep that's the correct method for getting icons, well done. If you need more help don't hesitate to ask mate. ;)