Skip Navigation

[Resolved] Show message when extra user field is not entered

This support ticket is created 5 years, 4 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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by pascalH 5 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1167106
show-massages.jpg

Good day

When a user has created an account, he can personalize his account.
For example, he can upload photos from his company, add a phone number, tell something about his business, and so on.

I would like to show a message on the my account page when these fields have not yet been completed.

For example; when the photo of the company has not been uploaded show text: You have not uploaded a business photo yet
It concerns this user field:
[types usermeta='bedrijfsfoto-1' title='%%TITLE%%' alt='%%ALT%%' size='properties' resize='stretch' current_user='true'][/types]

Another example; If no phone number is entered show text: You have not added a phone number yet
It concerns this user field:
[types usermeta='telefoonnummer' current_user='true'][/types]

I want to display the messages on the my account page, see added image.
Is this possible to do?

Can you explain to me how I can do this? or give me 1 example code?

Thanks in advance!
Pascal

#1167411

Waqar
Supporter

Languages: English (English )

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

Hi Pascal,

Thank you for contacting us and I'll be happy to assist.

To show a message, only when a certain user field doesn't have a value, you can use the conditional shortcode:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

For example, for the phone number and the image field, you can add the message like this:


[wpv-conditional if="( '[types usermeta='telefoonnummer' current_user='true'][/types]' eq '' )"]
// add message that phone number is not set
[/wpv-conditional]

[wpv-conditional if="( '[types usermeta='bedrijfsfoto-1' current_user='true'][/types]' eq '' )"]
// add message that photo is not set
[/wpv-conditional]

I hope this helps.

regards,
Waqar

#1168583

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.