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?
Hello,
Please provide your website credentials in below private message box, I need to test and debug it in a live website, thanks
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
I checked and activated the account and now it's working.
Thanks for the details, I am checking it in your website, will update here if find anything
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
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.
No, you need to use the taxonomy slug, as your custom taxonomy settings here:
hidden link
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.
My issue is resolved now. Thank you!