Skip Navigation

[Resolved] Dynamic Markers

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

Problem:

Display different marker icon by different post term.

Solution:

You can use [wpv-conditional] shortcode like this:

https://toolset.com/forums/topic/dynamic-markers/#post-2286417

Relevant Documentation:

This support ticket is created 3 years 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 3 replies, has 2 voices.

Last updated by andreS-5 2 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#2285115

Hi,
I tried to follow this instructions and even after hours of trying , it didn´t work: https://toolset.com/forums/topic/different-map-markers-based-on-custom-taxonomy/

I tried to have different marker pins based on the taxonomy.

The website is: hidden link

My shortcode is
[wpv-conditional if="(has_term('neighbourhood-typ', 'qualifying-patches', null) eq '1')"]
[wpv-map-marker map_id="map-5" marker_icon="<u>hidden link;" marker_id='marker-[wpv-post-id]' marker_field="wpcf-anschrift" marker_title=" "]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

Where is my mistake?

Thankyou for your help!

André Springhut

#2285459

Hello,

Did you add the function name "has_term" into Toolset setting page?
Dashboard-> Toolset-> Settings-> Front-end Content
In section "Functions inside conditional evaluations", add WordPress function: has_term

If you need more assistance for it, please provide a test site with the same problem, I need a live website to test and debug, thanks

#2286417
view-loop2.jpg

Thanks for the details, I have done below modifications in your website:
1) Create a new content template "marker-ct" with below codes:
hidden link

[wpv-conditional if="(has_term('qualifying-patch', 'neighbourhood-typ', null) eq '1')"]
[wpv-map-marker map_id="map-5"  marker_icon="<em><u>hidden link</u></em>" marker_id='marker-[wpv-post-id]' marker_field="wpcf-anschrift" marker_title=" "]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

You can customize above shortcodes by following our document:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

2) Edit the problem page:
hidden link
a) Find and select the map block, remove the marker settings
b) Find and select the view's loop block, add a content template block, and select the content template "marker-ct", see my screenshot view-loop2.jpg

Test it in frontend, I can see different marker icons correctly, please test again, check if it is fixed, thanks

#2287137

My issue is resolved now. Thank you!