Tell us what you are trying to do?
I want to show the distance only when there is a location from a custom field. So I was trying to use the [wpv-conditional] but I can't get it to show. Not using the conditional it works fine. But I want to hide it when the distance value is empty.
This is the code I tried.
[wpv-conditional if="( '[toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-member_address']' ne '' )"]
Afstand: [toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-member_address'] km<br />
[/wpv-conditional]
Hope you can help me.
Hi Herbie,
Thank you for getting in touch.
In this case you will need to do the conditional like below.
[wpv-conditional if="( '[types field='member_address'][/types]' ne '' )"]
Afstand: [toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-member_address'] km<br />
[/wpv-conditional]
Thanks,
Shane
Hi Shane,
Thank you.
Unfortunatly that will not work as the member_address field is never empty as this is the address field for maps.
So I need a way to check if the toolset-maps-distance-value is set or not. Or to see if the location filter (form field: toolset-maps-distance-center) is populated...
Hope you can help.
Hi Herbie,
Perhaps you can try getting the value of the distance field from the URL using this shortcode.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term
If you provide me with a link to the search I should be able to let you know what the parameter is.
Thanks,
Shane
Thank you Shane.
That pointed me to the right solution.
I am now using [wpv-conditional if="('[wpv-search-term param="toolset_maps_distance_center"]' ne '')"] and that works fine!
My issue is resolved now. Thank you!