Skip Navigation

[Résolu] Conditional output with custom image field in cred edit form

This support ticket is created Il y a 6 années et 6 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par vimalS Il y a 6 années et 6 mois.

Auteur
Publications
#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!!