Skip Navigation

[Resolved] Conditional Display

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

Problem:
The user used a conditional shortcode based on distance, but that was not working.

Solution:
The toolset-maps-distance-value is not registered as a shortcode that can be used inside conditional shortcode. Register it in Toolset->Settings->Front-end Content(tab)->Third-party shortcode arguments. Check this screenshot http://prntscr.com/ujzzts

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

This support ticket is created 4 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: Africa/Casablanca (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by krzysztofS-2 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1782175
toolset-maps-distance-value.jpg

Tell us what you are trying to do?
conditional display, compare a custom field with toolset-maps-distance-value value

I'm trying to compare custom field value [types field='maximum-travel-distance' format='FIELD_VALUE']
to [toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-your-address' decimals='0' unit='mi']' )" debug="true"]

It's not working. I created 2 conditional sets :

1. [wpv-conditional if="( [types field='maximum-travel-distance' format='FIELD_VALUE'][/types] gt 999 )" debug="true"]
Toolset Maps Distance Value = [toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-your-address' decimals='0' unit='mi'] [/wpv-conditional]

2. [wpv-conditional if="( [types field='maximum-travel-distance' format='FIELD_VALUE'][/types] gt '[toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-your-address' decimals='0' unit='mi']' )" debug="true"]
Working Now [/wpv-conditional]
First one working fine, as you can see on attached image, toolset-maps-distance-value is calculated correctly,
on second one I'm using "toolset-maps-distance-value " shortcode in conditional form, all dissapears, I can't even see debug info.

maximum-travel-distance value is set to 1000.
toolset-maps-distance-value showing 101
toolset-maps-distance-value is calculated correctly when is not used in the conditional display.
Can you advise how to sort it out?

What is the link to your site?
hidden link

#1782337

Hello and thank you for contacting the Toolset support.

I think that the toolset-maps-distance-value is not registered as a shortcode that can be used inside conditional shortcode. Register it in Toolset->Settings->Front-end Content(tab)->Third-party shortcode arguments. Check this screenshot hidden link

I hope this helps. Let me know if you encounter any issue.

#1783967

I had this shortcode registered in
"Functions inside conditional evaluations"
but not in
"Third-party shortcode arguments" as on screenshot.
I did it and now it's working. I didn't know that toolset map is a "third party"
Thank you for your help.

#1783969

My issue is resolved now. Thank you!