Problem: I have a Map View with Markers created using an address custom field. I would like to display a different Marker image based on the taxonomy terms applied to the post with the address field.
Solution:
Create three different Marker shortcodes and wrap each in conditional HTML. Test the slug produced by the wpv-post-taxonomy shortcode in the conditional like this:
[wpv-conditional if="( '[wpv-post-taxonomy type="status-woongroep" format="slug"]' eq 'wonend' )"] [wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" marker_field="wpcf-adres-woongroep" marker_icon="https://www.lvgo.nl/cms/wp-content/uploads/2018/08/google-map-home-woon.png" ]Wonend: <strong>[wpv-post-link]</strong>[/wpv-map-marker] [/wpv-conditional] [wpv-conditional if="( '[wpv-post-taxonomy type="status-woongroep" format="slug"]' eq 'initiatief' )"] [wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-adres-woongroep' marker_icon="https://www.lvgo.nl/cms/wp-content/uploads/2018/08/google-map-home-initiatief.png"] In oprichting: <strong> [wpv-post-link]</strong>[/wpv-map-marker] [/wpv-conditional] [wpv-conditional if="( '[wpv-post-taxonomy type="status-woongroep" format="slug"]' eq 'bouwend' )"] [wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-adres-woongroep' marker_icon="https://www.lvgo.nl/cms/wp-content/uploads/2018/08/google-map-home-initiatief.png"] In oprichting: <strong> [wpv-post-link]</strong>[/wpv-map-marker] [/wpv-conditional]
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
https://toolset.com/documentation/user-guides/display-on-google-maps/
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
This topic is split from https://toolset.com/forums/topic/converting-acf-fields-to-toolset/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 2 months ago.
Assisted by: Christian Cox.