Skip Navigation

[Resolved] I want to branch the display of user data list by "User Field"

This support ticket is created 7 years, 3 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.

Our next available supporter will start replying to tickets in about 0.63 hours from now. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by 直子 村上 7 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#565717
Q.png

Please look at this↓(Can you login?)
hidden link

I made User Field Group("Sample").
User Fields are "Display item A(Radio)","Item A(Single line)","Display item B(Radio)","Item B(Phone)".

If "Display item A" is "Yes",I want to display "Item A".
If "Display item B" is "No",I don't want to display "Item B".

Can I do something like this with Views or tIn other ways?

--------------
Like this
--------------
if("Display item A")
{
Display "Item A"
}
if("Display item B")
{
Display "Item B"
}
--------------

* I can not use PHP much.

#565731

Dear 直子,

Yes, it is possible within Views shortcode [wpv-conditional], see our document:
Checking Types Fields and Custom Fields
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/

And I can not login your website, if you need assistance for it, please provide the credentials of your website in below private detail box, I can setup a demo for you.

#565762

I have tried the credentials you provided, but get this error:
ERROR: The password you entered for the email address info@ufficio-di-fibonacci.com is incorrect

Please check it, thanks

#565774

So sorry!

I changed the password of the private message I sent before.

#565781

Thanks for the details, since you are using custom user field, so you will need to use the user shortcode insider the shortcode [wpv-conditional], for example:

[wpv-conditional if="( '[types usermeta='display-item-a'][/types]' eq 'Yes' )"]This field has value "my value"[/wpv-conditional]

More help:
Using shortcodes in conditions
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/

#565787

I can do it!
Thank you very much!

I wrote like this.

[wpv-conditional if="( '[types usermeta='display-item-a'][/types]' eq 'Yes' )"][types usermeta='item-a'][/types][/wpv-conditional]
[wpv-conditional if="( '[types usermeta='display-item-a'][/types]' eq 'No' )"]-Do not display item A-[/wpv-conditional]
[wpv-conditional if="( '[types usermeta='display-item-b'][/types]' eq 'Yes' )"][types usermeta='item-b'][/wpv-conditional]
[wpv-conditional if="( '[types usermeta='display-item-b'][/types]' eq 'No' )"]-Do not display item B-[/wpv-conditional]