Skip Navigation

[Resolved] Conditional output with custom image field in cred edit form

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

This topic contains 2 replies, has 2 voices.

Last updated by vimalS 6 years, 6 months ago.

Author
Posts
#878992

I have a edit profile form, in that I have added profile image field which is created by toolset.
Like this

[cred_field field='profile-picture' value='' urlparam='' output='bootstrap']

Now, my requirement is When there is no user image a placeholder with the initials is shown.

Initials means first letter of first name and last name.
How can I achieve this in cred field condition?

Thanks!!

#879155

Use simple HTML conditional.

An example is:

[wpv-conditional if="( '[types usermeta='the_user_meta_field' output='raw' user_is_author='true'][/types]' ne '' )"]
  [cred_field field='iamge-user' value='' urlparam='' output='bootstrap']
[/wpv-conditional]

[wpv-conditional if="( '[types usermeta='iamge-user' output='raw' user_is_author='true'][/types]' eq '' )"]
  whatever else (this is if there is no "the_user_meta_field" User Image uploaded to this profile.)
[/wpv-conditional]

DOC:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

#887643

Its working, Thanks!!