Skip Navigation

[Resolved] Display a filtrable list of users

This support ticket is created 7 years 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)

Author
Posts
#583628

Hi!
I'm creating a members only sites where users can see other users data. Just what Buddypress will do.

The thing is that I've created a all my custom field as _User Fields_ and just found out that all users related fields can not be used within Custom Search
"Only Views listing posts can have custom search inputs."

So I guess the questions are:

¿How can I create a View for all my users filtered by a specific Custom Field from the User Field?

¿ How can I create a Content Template for each user to show all my Custom Fields that will be access from this view ?

I would really appreciate if you can point me out to some documentation that will help me out. I already follow:
https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/

But this is not covering what I need.

Could you explain me how to approach this? Should I use CPT instead of User Fields?

Thanks!

#583762

Dear Cesar

I think it is possible within custom user fields.

Q1) How can I create a View for all my users filtered by a specific Custom Field from the User Field?
Yes, you are right, user view does not support custom search form, for example, there is a custom single line user field "my-user-field", you can create a view to list all users whose "my-user-field" field value is same as current user's, for example:
1) Create a view "my-user-view", list users, filter by Usermeta field filter:
Select items with field:
my-user-field is a string equal to VIEW_PARAM(myuserfield)

2) display above view like this:
[wpv-view name="my-user-view" myuserfield="[types usermeta='my-user-field' user_current='true'][/types]"]

More help:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
section "Controlling the filter with shortcode attributes"

Q2) How can I create a Content Template for each user to show all my Custom Fields that will be access from this view ?
Could you elaborate the question with more details?
What kind of content template do you need, what custom do you want to show? how do you setup the view?
I need to test it in my localhost ,thanks

#583931
toolset-help.png

Thanks so much for your support,

Q1)
I followed your instruction but can't found VIEW_PARAM, see the attached image bellow. Content selection is set to Users/Any role
Is there something I'm missing?

Q2)
you are right, this was difficult to explain, but I manage to make it work with views and a pretty useful Query that filter users by ID

Thanks!

#583985

It is the option "Shortcode attribute" in your screenshot:
hidden link

#584013

Thanks

#1606557

I have same issue. I need a page, "Display a filterable list of users"
This post is not helpful because I'm using Toolset Blocks which I can't use View plugin.
Would you explain how to do it with "Toolset Blocks"
Or is there any document for this? Please let me know.
Thanks,