Skip Navigation

[Résolu] conditional output user view

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: I would like to use conditional HTML output based on the value of a custom user field.

Solution: Use the following conditional syntax:

[wpv-conditional if="( '[wpv-user field='wpcf-link-website']' ne '' )"]
  ...show link
[/wpv-conditional]

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

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Marqué : ,

This topic contains 2 réponses, has 2 voix.

Last updated by Dido Il y a 6 années et 11 mois.

Assisted by: Christian Cox.

Auteur
Publications
#519498
cond.jpg

HI,

on this page hidden link You see a view of users

I made custom user fields for website and company name.
if there is no url I want to show the companu name without link.
if there is an url, I want the link on the company name.

I can't find the right conditional output code.
is this because it is an user view? I can't find the right fields either.

see screenshot

#519512

Hi, yes it's because this is a User View. As a workaround, please try the following conditional to test if the website field is not an empty string:

[wpv-conditional if="( '[wpv-user field='wpcf-link-website']' ne '' )"]
  ...show link
[/wpv-conditional]
#520919

This works perfect, thanks a lot

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