Skip Navigation

[Resolved] Chaining conditional syntax in Views

This support ticket is created 5 years, 4 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/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by triD 5 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1349625

I have a conditional clause in my View, and wondering why chaining additional logic does not work.

This works:
[code]
[wpv-conditional if="(( '[wpv-post-id]' eq '309' ) AND ( '[wpv-taxonomy-id]' eq '102' ))"]
hello
[/wpv-conditional]
[/code]

This doesnt work:
[code]
[wpv-conditional if="(( '[wpv-post-id]' eq '309' ) AND ( '[wpv-taxonomy-id]' eq '102' )) OR (( '[wpv-post-id]' eq '3092' ) AND ( '[wpv-taxonomy-id]' eq '109' ))"]
hello
[/wpv-conditional]
[/code]

Does anyone know why the OR part does not get executed?

Thanks

#1349787

Hi there,

Thank you for contacting us and I'd be happy to assist.

I've tested the chained condition similar to the one that you've shared and it works as expected on my test website.

To confirm how you're using this on your website, are you testing this inside taxonomy view, where "[wpv-post-id]" checks for the page/post ID, where this view is inserted?

In case the issue still persists, you're welcome to share temporary admin login details of the website, where you're testing this and I'll be able to investigate this, accordingly.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1349835

Hi Waqar, thank you for confirming that it works on your end. I checked again and it appears to be user error on my part. It does work as i expected. Thanks again.