Skip Navigation

[Resolved] Different map marker for each of the terms within a taxonomy on map view

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 10 replies, has 2 voices.

Last updated by winyS 1 year, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#2611957

I try to achieve the same as in this topic: https://toolset.com/forums/topic/different-map-marker-for-each-of-the-terms-within-a-taxonomy-on-map-view.

My test site is: hidden link
(you can login with password lvgo2023)

This is the code I used:
<!-- woongroep icon -->
[wpv-conditional if="(has_term(‘woongroep’, ‘status’, null) eq '1')"]
[wpv-map-marker map_id="map-1" marker_icon="hidden link" marker_id='marker-3-[wpv-post-id]' marker_field="wpcf-adres-woongroep”]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

<!-- initiatiefgroep icon -->
[wpv-conditional if="(has_term(‘initiatiefgroep’, ‘status’, null) eq '1')"]
[wpv-map-marker map_id="map-1" marker_icon="hidden link" marker_id='marker-3-[wpv-post-id]' marker_field="wpcf-adres-woongroep”]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

Unfortunally the desired different markers don't show up.

Can you see what I did wrong?

#2612097

Hello,

Please provide your website credentials in below private message box, I need to test and debug it in a live website, thanks

#2612529

I have tried the credentials you provided above, but get below error message:

FOUT: Gebruiker is niet geactiveerd

Please check it, make sure it is a valid admin account, thanks

#2612613

I checked and activated the account and now it's working.

#2612803

Thanks for the details, I am checking it in your website, will update here if find anything

#2612805

I have done below modifications in your website:
Edit the page:
hidden link
1) Find and select Toolset Map block, in the map block setting panel, remove all markers
2) In view's loop, replace the custom HTML block with a shortcode block, display the map shortcodes like this:

<!-- woongroep icon -->
[wpv-conditional if="(has_term('woongroep', 'stadium', null) eq '1')"]
[wpv-map-marker map_id="map-1" marker_icon="<em><u>hidden link</u></em>" marker_id="marker-[wpv-post-id]" marker_field="wpcf-adres-woongroep"]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]
[wpv-conditional if="(has_term('initiatiefgroep', 'stadium', null) eq '1')"]
[wpv-map-marker map_id="map-1" marker_icon="<em><u>hidden link</u></em>" marker_id='marker-[wpv-post-id]' marker_field="wpcf-adres-woongroep"]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

Please test again, check if it is fixed, thanks

#2613325

Hi Luo,
It's fixed. Great support!
I am trying to understand the code you added.
Can you explain the following?
You have changed this:
[wpv-conditional if="(has_term(‘woongroep’, ‘status’, null) eq '1')"]
to this:
[wpv-conditional if="(has_term('woongroep', 'stadium', null) eq '1')"]
I thought that 'status' was the taxonomy name. You changed it into 'stadium'. There is no taxonomy named 'stadium'. The terms ‘woongroep’ and 'initiatiefgroep belong to the taxonomy 'status'.
Can you explain why you changed this and where it comes from?
Thank you.

#2613687

No, you need to use the taxonomy slug, as your custom taxonomy settings here:
hidden link

#2613775

Thank you Luo,
Now I understand it.
Is there a page where I can learn more about creating the code for conditional display in Gutenberg? I found these pages:
* https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/
* https://toolset.com/documentation/legacy-features/views-plugin/displaying-taxonomies-conditionally/
But these refer to legacy features.

#2614119

You can follow our document to setup the conditional block:
https://toolset.com/course-lesson/using-toolset-conditional-block/

#2614123

My issue is resolved now. Thank you!