Display a list of users/members in a block
Permalink 1 user found helpful
Hello,
Our site has a group of users (we call members) that need to be listed on our site for everyone to see. We do not want anyone to login to see the list.
The users belong to one group in concrete5.
Is there a built in option to display a list of the users in the group?
I haven't found anything that works.
Will I need to make a block?
With only knowing the group name, how do I go about finding all the users and then display their attributes (ideally specific attributes) for everyone to see?
Our site has a group of users (we call members) that need to be listed on our site for everyone to see. We do not want anyone to login to see the list.
The users belong to one group in concrete5.
Is there a built in option to display a list of the users in the group?
I haven't found anything that works.
Will I need to make a block?
With only knowing the group name, how do I go about finding all the users and then display their attributes (ideally specific attributes) for everyone to see?
you don't necessarily need to make a block. You can just use a single page instead if you want. but basically you'll just need to use the UserList class, in the /concrete/models/ directory. It provides an easy way to get all users for a group.
Again, thanks for the response.
This will give me an array of each user. Yay!
What to do with that?
<?php echo $userList->getUserGender()?>
<?php Loader::model('user_list'); $userList = new UserList(); $userList->filterByGroup('members'); var_dump($userList->get());?>
This will give me an array of each user. Yay!
What to do with that?
<?php echo $userList->getUserGender()?>
Is this the answer up above? The quoted code + the php echo line is all I need to make this happen?
Thanks!
Thanks!
bump
@Zoinks: Yes, this is how you get users by group. It would probably have saved you time if you put this code into a file and ran it, rather than waiting a month for a response.
Hah. I really wanted to mark this as the best answer.
too slow.
Any updates on this, as it does not seem to work on fresh installations of C5.
Thanks.
Thanks.
You can have a look into http://www.concrete5.org/marketplace/addons/enhanced-user-list/...
Though this add-on says "No Longer Available", but still I purchase this and do some customization to make it working. Now its working fine and fulfill the requirements.
Rony
Though this add-on says "No Longer Available", but still I purchase this and do some customization to make it working. Now its working fine and fulfill the requirements.
Rony
User1, User2, and User3 all belong to Group1.
I want to have a simple list displayed on the website, for everyone to see, that shows all of the users in the group.
Is there something to built into Concrete5 for this?