Skip Navigation

[Resolved] Views conditional output wizard what is the syntax

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.

Our next available supporter will start replying to tickets in about 2.33 hours from now. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 4 years, 8 months ago.

Assigned support staff: Beda.

Author
Posts
#488071

I am trying to: Using Views create a conditional output in view with the condition being:

Post title [wpv-post-title] not containing the string ABC

Cannot figure out the syntax needed.

Thank you

#488246

This is not possible with the inbuilt Toolset Conditional HTML.

The reason is, we don't know where you want to check that String.
It can be at the begin, or split up A, B and C, or all concatenated?

A "Contains" evaluation is not available within the native HTML conditional.

What you can do is create a Custom Function that does this for you, and after registering it in Toolset > Settings, you can evaluate if it returns (example) true or false.

This function should do all the evaluation (if contains) for you, and if it matches, it should return True, otherwise False, and that is what you will then use in the comparison in the HTML conditional.

Such a function should get the Post Title and scan it for your specific String configuration and evaluate whether or not it finds it.
You could use this PHP function for it:
hidden link

Here is an example of its usage:
http://stackoverflow.com/questions/4366730/how-do-i-check-if-a-string-contains-a-specific-word-in-php

It seems that you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/

You will get the custom assistance you need to get on with your project.