Skip Navigation

[Resolved] wpv-conditional not working as expected for parent field value

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

Problem:
Views conditional statement using [wpv-conditional] shortcode not working.

Solution:
User was using nested [wpv-conditional] shortcode. One of the [wpv-conditional] shortcode is not ended properly due to that [wpv-conditional] shortcode was not working as expected and displying wront output.

Key points to remember:
- Make sure you have write right field names
- Make sure you have properly ended nested [wpv-conditional] shortcodes
- You may try to follow View GUI to generate conditional statements

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

This support ticket is created 8 years, 1 month 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by nedG 8 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#382220

I am trying to evaluate a field of parent CPT. The parent CPT has a slug called "events". ANd the field I am trying to display is the "venue-address" field.

If I insert the following shortcode into my page...

[types field="venue-address" id="$events"][/types]

Then it displays the value of 1

This is correct and disaplys fine.

However, I cannot seem to get the following wpv-conditional to work....

[wpv-conditional if="('[types field="venue-address" id="$events"][/types]'='1')"]

This SHOULD be evaluated as TRUE.... ('1'='1')

I have tried it many different ways and I cannot get it to be evaluated properly. It used to work just fine and I am not sure what happened. I have spent hours on this.

Please help.

#382395

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try following code:

[wpv-conditional if="('[types field='venue-address' id='$events'][/types]' = '1')"]

condition is working - you are inside condition

[/wpv-conditional]

#382657

Unfortunately that did not work either.

I am really baffled by this. It used to work just fine.

#382659

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I understand how frustrating this situation is. This might be related to new update.

Could you please tell me which view you are using?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#383495

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

We have just release BIG update for all Toolset plugins.
=> https://toolset.com/2016/04/toolset-2-0-unifies-menus-improves-usability-and-adds-new-features/

*** Please make a FULL BACKUP of your database and website.***
Could you please try to update your Views plugin to latest version 2.0 as well as ALL Toolset plugins to it's latest official release version. You can download latest Toolset plugins from:
=> https://toolset.com/account/downloads/

If your issue still persists - Please do not hesitate to get in touch with me.

#383719

I have done a complete update of all TOOLEST plugins. The problem still persists.

#383884

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I further debug your issue and I found that you have many nested [wpv-conditional] statement and one of them is not ended properly. I've made the correction and it seems working now.

Could you please check and confirm that this solution help you to resolve this issue.

#383949

OMG, I see what you mean. I am not sure when those were missed. I appreciate you taking the time and finding that issue. I should have been able to spot that.

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