What is the value for Group Names?

My plugin is currently in need of some massive sorting, and I thought the best to do would be to order them by their names. Usually, groups are automatically sorted by e.time_created, but I would prefer by name for easier access.


However, it seems that I just cannot seem to find what actually controls that. I have used  e. and g. for both title, and name. Looking around the discussions too see to say that .name and .title should work, but I am having absolutely no luck at all.


Is anyone able to assist me?

Keep in mind, my elgg version is 1.8.

  • Keep in mind, my elgg version is 1.8.

    Update to a newer version, Elgg 1.8 hasn't been supported for a long time ;)

    In your $options for elgg_get_entities() add:

    $options['joins'][] = 'JOIN ' . elgg_get_config('dbprefix') . 'groups_entity ge';
    $options['order_by'] = 'ge.name ASC';

    That should work

  • That worked well enough, doesnt allow me to sort it for whatever reason but im sure I will figure out why. Thanks!

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