The users directory has gotten a tune-up and is now much more aligned with the leaderboard functionality that people have been asking for. Here is a quick overview, and then I’ll break down each change more below:
- Directory columns can be disabled/enabled and reordered
- Users can be filtered by group
- Public user fields can now be enabled as columns in the directory
- Plugins can add directory columns. Discourse-solved adds solutions count to the directory.
Click the wrench
And a modal will appear to enable/disable and reorder the columns
By default, the value of the dropdown is “all groups”, but that can be changed to only show users that are a part of a specific group. This means you can now create leaderboards for specific groups.
Admin-created user fields can be enabled as columns in the directory, if the user field is shown on user profile or user card. Below, I have 3 user fields and only “Favorite Color” is visible on user card and profile. Now in the “Edit Directory Columns” modal, “Favorite Color” is an option to show in the directory. This means you can now create searchable user directories.
The only example of this currently is in the discourse-solved plugin. The plugin now adds a column to the directory which is the number of solutions a user has posted.
In the plugin.rb file, a directory column is added with a query that will be executed to calculate the value for the column. Then the “Edit Directory Columns” modal has the new column default disabled. You can see this here on meta - Discourse Meta