I'm a freelance Drupal developer who loves enabling organizations switch to free and open source software.
This is an update of the old and outdated article "Drupal member list" which was written for Drupal 4.7 and Drupal 5 when it was just released. This article applies to Drupal 5 and 6.
Since then I stopped working on the Drupal 5 version of the members module. The main reason is because eventually all functionality is better handled by installing a user-as-node module and integrating it with views. My personal favorite for this is usernode because it comes with a default view that you can use out of the box or customize to your needs:
admin/build/views and add the userlist view.When adding the userlist view you can also include any profile fields you'd like to display, or the avatar for instance. Using this default view you can easily create a block that displays the 10 newest users in a list with their username and avatar or enable views alpha pager to create an alphabetical listing of all your site's users.
For Drupal 6 there's no need for a user-as-node module: views 2 allows for creating user listings all by itself! There's even a manual page on it in the amazing documentation: Create a page to list users by role. There's also no need to install an extra module to create an alphabetical listing, you can just use the glossary styles for that!
Tweet
Comments
Great info
Thanks for the info on creating the user list by role, this is something I have been needing to do for a while and seems like an easy solution with Views. Also nice to see a page dedicated to View help, thanks for the link!
Drupal 6
Have you tried creating a user list using drupal 6, cck 2 and views 2? I have just followed the manual and it does not work.
The view only displays a user when that user has create a piece of content. Also: for each piece of content that user creates the user list view displays the user again. So if the user has made 3 pieces of content their name will appear 3 times in the user list.
Do you how to fix this?
regards
Jamie
Set distinct & file a bug
To avoid duplicates you can set "Distinct" to "Yes".
About people only appearing after having created a node there are two things you can do: first of all file a bug report and see if this behavior is by design or an actual flaw. Until that is resolved you can write a small module that automatically creates an unpublished node (of a completely separate content type) for that user.
Can you clarify
Hi.
I know this thread is old. But I just need to clarify.
Do you have to make a content-type in order to get a listing of users, or is that a misprint. I cant get Views 2 to show a list of users with a specific role (without the duplicates)
Regards
Mikkel Tiedt - Cph Denmark
It's really easy to do. When
It's really easy to do. When creating the view choose for the user type. Then put a filter on "user: roles" and be sure to set Distinct to "Yes".
This was the problem for me
I had the same problem and this was the solution. Changing the view type from node to user and adding distinct was the solution, thanks to the community!
Views Users List
I wanted to reply to this post because I had the same problem with duplicating users. You may have figured it out by now, but the help file in Drupal fails to mention the most important thing when you create this content type. You have to select "Users" not "Node" as the type. I spent hours trying to figure this out, then just took a shot and this seems to be the solution.
Views Users List
Thank you, thank you, thank you, commenter! Creating view type "user" when creating the view was the trick. I couldn't find this advice anywhere else. I'm so used to creating node type views, I don't see the other types.
profiles vs nodes
Thanks for your advice here, Wim. I've come a bit unstuck with it though in that I can make a nice table as you outline, but the links from usernames go to new blank nodes for each user, not the profiles which currently hold all the data that you might want to click through to.
Do you know of a way please to tie these two together? Your v5 members module had the links nicely pointing to the relevant profiles, but the views default doesn't seem to have a way to achieve this.
Thanks and best wishes, John
theme your views
I assume you're looking for a solution with Drupal 5. I think the cleanest solution is to theme your views and change the link from the user node to the actual user profile. You can find more information in the handbook page on how to theme views.
Thanks!
Many thanks for the speedy response Wim! Well, that goes a bit over my n00b head, so I'll probably have to come back to it when I understand more about how Views works. Very much appreciate the helpful pointers though - I think I get the kind of task that's needed here now as a result of reading up on those links you gave. In the meantime, I'll stick with your own update of the members list module for this function, until I've been able to get closer to an understanding. Best wishes (and have a good festive season!)
Question
Hey Wim,
Are you saying that the "old" method as described in the legacy article does not work anymore for newer drupal 5 versions? I'm trying to get it to work in Drupal 5.13, but to no avail.
Members module has been disctontinued
The members module has been discontinued in preference of the method described in this article. You can still download and use the members module for Drupal 5 but it is no longer maintained so it's highly advised to not use it anymore.
Members of a Group
I want to show detailed list of Members in a group .... using drupal 6....right now I see simply the user names one by one when I added a block called 'group members' but I need to show phone, address and other details of a member of a group. Please guide.
Limited number of users
This technique appears to only return a limited list of users under drupal 5. I have a site with 30k+ users and this will only enumerate about 150 of them.
Thanks for this post! Sub for
Thanks for this post!
Sub for me!
Post new comment