Skip Navigation

[Resolved] Conditional Statements

This support ticket is created 5 years, 6 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 1 reply, has 2 voices.

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

Assisted by: Luo Yang.

Author
Posts
#1220524

Tell us what you are trying to do?

I need to make this statement work without errors
[wpv-conditional if="( $(wpcf-select-page) ne '' ) AND ( '[wpv-post-slug item="$parent"]' eq $(wpcf-select-page) )"]
[types field='select-page' output='raw'][/types]
[/wpv-conditional]

#1220689

Hello,

Please elaborate the question with more details:

1) How do you setup the custom field "select-page"? please take a screenshot for it

2) The shortcode [wpv-post-slug item="$parent"] works only for hierarchical post type, have you tried output it directly?
Dose it output correct values?
See our document:
https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/
$parent is used to retrieve data from a hierarchical parent if the current post is a type of hierarchical post such as a page.

3) You can also debug the [wpv-conditional] shortcode by adding attribute debug="true", for example:

[wpv-conditional ... debug="true"]
...
[/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/debugging/
Using the debug mode

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