Skip Navigation

[Closed] Conditionals based on parent custom field

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

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Shane 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1978677

I can't get it to work:

[wpv-conditional if="( '[types field='downpayment-type' output='raw' item='$development-extras.parent'][/types}}' eq 'Dollar Amount' )"]
$[types field='listing-financing-downpayment' item='@development-extras.parent' output='raw'][/types]
[/wpv-conditional]

I tried using the fix suggested here: https://toolset.com/errata/wpv-conditionals-populated-with-types-fields-not-from-current-post-as-at-a-origin-will-fall-back-to-the-current-post-data/

I tried it with "$" and "@" within the conditional for item. I also previously tried the usual method, with if='(wpcf-downpayment-type)' as well.

I must have the syntax wrong somewhere. What's the proper way to do this?

#1978745

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for getting in touch.

Can you let me know what displays when you just use the shortcode alone.


Parent Field - [types field='downpayment-type' output='raw' item='@development-extras.parent'][/types}}

Add the the above to your page and let me if anything displays.

Secondly if it does display try the conditional like this and enable the debug and send me the debug output that will be printed on the frontend.


[wpv-conditional if="( '[types field='downpayment-type' output='raw' item='@development-extras.parent'][/types}}' eq 'Dollar Amount' )" debug='true']
[types field='listing-financing-downpayment' item='@development-extras.parent' output='raw'][/types]
[/wpv-conditional]

Thanks,
Shane

#1979953

Hi Shane, when I put in the first bit of shortcode, the info displays.

However, when I put in the other shortcode, nothing shows up. And there's no debug info appearing either.

[wpv-conditional if="( '[types field='downpayment-type' item='@development-extras.parent'][/types]' eq 'Percentage' )" debug='true']
[types field='financing-percentage' item='@development-extras.parent'][/types]%[/wpv-conditional]

You can see it in the financing section part way down this page: hidden link

Downpayment type shows, but not amount. (Don't know if it makes any difference, but the custom field "Amount" is conditional on the "Type".)

Any further suggestions?

#1979987

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Would you mind allowing me to have admin access to the page that you are running this test on so that I can have a look to see what is happening here?

I've enabled the private fields for your next response.

Thanks,
Shane

#1984045

Actually, it appears the issue is with shortcodes nested within shorcodes. I'm using Thrive Themes Architect to build my page: a Types field shortcode on its own displays, as does a View.

However, when I try to use a conditional or other shortcode that references a Types CF, it doesn't work. So no shortcode within another shortcode.

I tried plugging the conditional into a content template and inserted that code into the page builder, but still nothing.

I know you can't provide help as it relates to 3rd-party apps, but is there a more general reason why this might be happening and a possible solution to try?

In other words, is there something I can do at the Toolset end that might solve this?

#1984355

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for the information, would you mind allowing me to have admin access to the site so that I can see the setup exactly ?

I tried plugging the conditional into a content template and inserted that code into the page builder, but still nothing.

This is mainly my concern as if you add the conditional to a content template it should work. I've enabled the private fields for your next response.
Also please send me the page where you are testing this out so that I can know exactly where to look.

Thanks,
Shane

The topic ‘[Closed] Conditionals based on parent custom field’ is closed to new replies.