Members page listing display

Here we go again:)   Using Elgg 1.8.12

On members page/members search page the list of members displays for each member: icon, user name, location. This question is about that "location" field data displayed.

How can I change that to display different profile field?

I looked all over inside the members mod, engine/lib but can not find where is this defined, to display "location" field. I know it uses summary.php but in there nothing points to "location" field.

Anyone knows where it is or point me to discussion that deals with this?

Greatly appreciated.

  • tell me i am not going blind !;-P i do not see ' location' on my xampp ;-o( you're using some plugin ?

  • @Dhrup: the location info surely gets added (apart from the members list for example also to the friends list) - and who would have known you are from "Array" like so many others, too. :)

    The location info that gets listed is an element of the user's entity menu. The entity menu for a Elgg user entity gets defined in engine/lib/users.php starting at line 1315 (Elgg 1.8.12) in the funtion elgg_users_setup_entity_menu(). This is done via a plugin hook (elgg_register_plugin_hook_handler('register', 'menu:entity', 'elgg_users_setup_entity_menu', 501);). So, you should be able to unregister the location entity menu item and/or add your own custom menu item with another data field instead by setting up a plugin hook in the same way in your own plugin.

  • hehh! i got it! he said it badly ;) he *wants to change the display to also show location.. thats why i dont see it hah ;-P gotta be time for a coffee then @now..!

  • Wow, I would have never found it :)

    I was looking for some elgg_view extend file in the views folders lol , I looked in engine/lib folder too but obviously in wrong files :)

    Wonder how many things are now defined like that (just with hooks, without using view files to do it)

    Thanks iionly

    @DDS, thanks for the effort :)

  • All menu items are done that way in 1.8.  If you looked at the markup for that section you should have seen that it's in the 'entity menu' - that lets you know to use the hooks  :)

  • Yes I did notice that but had no clue that gives the hook type, good to know :) Thanks Matt

    As soon as I unregistered the location hook now it shows user's access level instead. where is that hook It's not in user.php?

  • i found out why i could not see 'location' on the screen - not blind at all ;-P no data on my xampp lolzzz ;-oO;X;P

  • haha, yup if user don't have a value in location field, it shows nothing :)

  • all of the items in the menu will be available in that hook.  You may have to call the hook later in the process (try 1000 instead of 501) if you can't see them all.

    Try var_dump($return) in the hook handler to see what's registered, you can iterate through the return value and add/remove/modify whatever you need before returning the new value.

  • That worked like a charm :) Thanks

    Another question:

    I would like to create another custom menu. I know how to create the menu but my question is how do I define where this menu to be displayed?

    Do I have to add elgg_view (menu_name) in the file I wanted it to display on or is there a hook to add this menu automatically to specific place on the page?

    I'd like to add this new menu in the activity items ( like elgg_menu_river that displays comment bubble and like icon)

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking