Skip Navigation

[Resolved] filter via on custom user field

This support ticket is created 7 years, 1 month 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Noman 7 years, 1 month ago.

Assisted by: Noman.

Author
Posts
#578958
Schermafdruk 2017-10-16 10.21.57.png

I am trying to:
Filter a view on a custom user field 'id-werkeger' tot show only those field in te view where the CPF 'werkgeversnummer-otib' is the custom user field 'id-werkgever'

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#578977

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

User view.png

Hi Jacques,

Thank you for contacting Toolset support. From your description I can understand that you want to create a User view and apply Query filter on custom user field. I have attached the screenshot, please match it with your view.

If you are not able to achieve this, please provide complete screenshot of the view, link to the page where you have inserted this view and backend screenshot of the custom user field.

Thank you

#578981

Noman, yanks for your quick reply.

No I don't need a user view but a view on the CPT 'werkgevers' . This CPT has a field 'werkgeversnummer-otib'. I want to filter the view so the loggedin user sees only the posts that equals the user metafield "id-werkgever' with the CPT field "'werkgeversnummer-otib'.

#579025

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Ok I can try on that, can you please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and check the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

#579088

Permission to turn on and off plugins

#579089

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for sending the login info. But the page is not working, when I open it shows a “Sorry” no page found message. Also I am not sure which page or View you are using at moment.

This is conditional method & syntax you need to use for the required conditions as you have asked for:

 
[wpv-conditional if="( $(wpcf-resolved-by) eq '[types usermeta='facebook-url' user_current='true' output='raw'][/types]' )"]

your content goes here…

[/wpv-conditional]

==> Whereas in the above shortcode “wpcf-resolved-by” will be your CPT custom field slug.
==> “facebook-url” will be your usermeta field slug.

So please try it in your View and let me know if this condition is good for your case. Thank you

#579152

Wauw Noman. It works. Thanks.

Is it also posible to show a page from the view. So the page only shows the information of the user who's filtered by the conditional in the view like before?

#579288

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

For the above question, I am bit confused that what you are trying to achieve, do you want to insert any page inside view?
Please explain in more detail with screenshot and link of the page and view.

Thank you