Skip Navigation

[Resolved] Wpv-condition

This support ticket is created 5 years, 5 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
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)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1312405

Hello
i have this condition and i like to add a condition that looks if the URL has "https or http" in the wpcf-website
as you can see ha manually added https in the a-tag, but not a good way to do it. But if the url dont have any http or https, the link will not be an link.

Can you pls show me how i can add a condition to see if in contant http/https in the wpcf-website ? 🙂

this is what i have. this looks if there is any value at all.

[wpv-conditional if="( $(wpcf-website) ne '' )"]
<br>
hidden link field='website' output='raw'][/types]">Besök webbplats</p>

[/wpv-conditional]

#1312461

You can use the LEFT function to inspect the first 5 letters of the URL field like this:

[wpv-conditional if="( LEFT($(wpcf-website), 5) eq 'https' )"]This url is HTTPS[/wpv-conditional]
[wpv-conditional if="( LEFT($(wpcf-website), 5) ne 'https' )"]This url is null or not HTTPS[/wpv-conditional]

These functions work in the conditional engine: https://toolset.com/documentation/user-guides/cred-conditional-display-engine/#functions