Skip Navigation

[Resolved] Creating Complex Views Filter with ANDs and ORs ?

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to display video recording links from an Event. Some events have a pre-event meeting that also has a video recording. I have more than one type of event so, I only want to display the video links that are of event Type 1 AND the video recording link field is not empty - OR the pre-event video recording link field is not empty. Logic should be something similar to this:

if ( (event-type === '1') AND ( (video-link-1 > 0) OR (video-link-2 > 0) ) )

Solution:

I suggest you try this:

1) Edit your view, setup the filters as:

(video-link-1 > 0) OR (video-link-2 > 0)

2) In the Views loop, use shortcode [wpv-conditional] to check the custom field "event-type" value, if the value is "1", then display this item.

Relevant Documentation:

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

This support ticket is created 6 years, 8 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#622348
Screen Shot 2018-03-05 at 4.12.03 PM.png

Tell us what you are trying to do?
I want to display video recording links from an Event. Some events have a pre-event meeting that also has a video recording. I have more than one type of event so, I only want to display the video links that are of event Type 1 AND the video recording link field is not empty - OR the pre-event video recording link field is not empty. Logic should be something similar to this:

if ( (event-type === '1') AND ( (video-link-1 > 0) OR (video-link-2 > 0) ) )

Is there any documentation that you are following?
I can't find the doc necessary for creating a complex text-based view filter.

Is there a similar example that we can see?
No.

What is the link to your site?
hidden link

NOTE THAT THIS PAGE CURRENTLY SHOWS ONLY LINKS FROM video-link-1 FIELDS because I can't figure out how to show either or both..

#622437

Hello,

As you can see there isn't such a built-in feature within Views plugin, if you agree, we can take it as a feature reques, our developers will evaluate it.

Currently, I suggest you try this:
1) Edit your view, setup the filters as:
(video-link-1 > 0) OR (video-link-2 > 0)
2) In the Views loop, use shortcode [wpv-conditional] to check the custom field "event-type" value, if the value is "1", then display this item:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

#622726

Excellent. I should have thought of that. Thanks for your help, Luo.

By the way, I did not receive an email notification of your reply. I just happened to check this page and saw your answer. I checked all my mailboxes, including SPAM and Junk.

This happened to me awhile back last year sometime, and then it resolved by itself.

You can mark this issue as resolved. Thanks again.
Jeff Safire

#622788

It might be a mail server issue, you can change your email to gmail account, test again, and feedback if the problem still persists.

As your request, I have marked this thread as resolved.