As I mentioned, since this is a new topic, I am starting a new thread.
The shortcode [bpmtp-member-list] works great, also when I apply a member_type filter, and change the type to alphabetical…
but, when I try to get a list of Users based on an x-profile field, like this:
[bpmtp-members-list member_type=organizer type=alphabetical meta_key=Country meta_value=Germany]
I get no users.
I also tried:
[bpmtp-members-list member_type=organizer type=alphabetical search-terms=Germany]
Which shows me all users.
Am I forgetting something?
Thank you for asking.
The first use will not work as you are using the meta query but you are not searching for meta query. BuddyPress profile field data is not stored in user meta.
The second case will work if you change ‘search-terms’ to ‘search_terms’
The currently supported options are:-(Example shows an array, you will use = instead of => in shortcode)
'type' => 'active', 'page' => 1, 'per_page' => 20, 'max' => false, 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users. 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users. 'user_id' => false, // Pass a user_id to only show friends of this user. 'member_type' => '', 'member_type__in' => '', 'member_type__not_in' => '', 'search_terms' => '', 'meta_key' => false, // Only return users with this usermeta. 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key.
Query based on profile field is possible using xprofile_query but it needs multi dimensional array(which is difficult to allow in the flat shortcode options).
I will be looking at ways to improve it in future.
Please try the ‘search_terms’ and let me know if it works or not?
Could there be a way to add values into the shortcode to manually order the directory?
For example, perhaps order alphanumerically based on an xprofile value?
My hope is to manually order a directory for managers based on their seniority – not alphabetically.
Thanks for letting me know Brajesh. Good to know before I spend too much time on this 😄
It’s too bad there is no way to manually order the members yet in Buddypress…
Just an idea for future: I wish there was a way to use the user_id method but somehow pause and restart the loop between each id so that you can manually sort them by user_id number such as id 5, then id 3, then id 10 etc.
Aside from that, thanks again for an invaluable plugin. Love it.
That’s great to know thanks Brajesh!
Due to the nature of this particular directory which needs to be manually ordered, I’ve used the following method:
– used [bpmtp-members-list include=”…”] shortcode and inserted a single ID in the quotes
– repeated the shortcode for each member ID [bpmtp-members-list include=”10″][bpmtp-members-list include=”24″][bpmtp-members-list include=”17″] etc.
– used CSS to hide #pag-bottom and float and style each member as needed
– in this particular scenario, I am using a theme framework to create each member in their own columns
So far, so good for the time being 😄
- This reply was modified 6 years, 2 months ago by xmginc.
You must be logged in to reply to this topic.