Skip Navigation

[Resolved] Create different lists (directories) of users based on the value specified in a custom field

This thread is resolved. Here is a description of the problem and solution.

Problem:

How to create different lists (directories) of users based on the value specified in a custom field?

Solution:

The Toolset user view does not support custom search form yet.

But it is possible to filter the result by view's shortcode attribute, for example:

https://toolset.com/forums/topic/create-different-lists-directories-of-users-based-on-the-value-specified-in-a-custom-field/#post-1975317

Relevant Documentation:

https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#accessing-the-arguments

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by J S 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1975233

J S

Thank you Luo! This is working now.

What would you recommend now for being able to create different lists (directories) of users based on the value specified in a custom field? I have a select field for each user called 'wpcf-aceer-role'. This field has several values (board member, intern, conservation fellow etc.). I would like to create pages for each of these types of users, i.e. a page for board members, a page for interns etc. On these pages, I want to link to the individual profile or author archives shown above.

I have a crude version of the complete user directory at this link: hidden link and the view profile link goes to the /author/username archive page as desired. I would like to either add a filtering option to the directory page (which I don't think is possible for user archives) or create several versions of the directory page, one for each user type.

What do you recommend for that?

Thank you!!

#1975317

Hello,

The Toolset user view does not support custom search form yet.

But it is possible to filter the result by view's shortcode attribute, for example:
1) You can create a view "my-view":
- Query users
- Filter by:
Select items with field:
wpcf-aceer-role is a string equal to VIEW_PARAM(aceerrole)
- In view's loop, display user information

2) Display above view's shortcode with different attribute "aceerrole" values, for example:

[wpv-view name="my-view" aceerrole="abc"]
...
[wpv-view name="my-view" aceerrole="efg"]

More help:
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#accessing-the-arguments

#1976907

J S

My issue is resolved now. Thank you!