[Resolved] Maps – how to make a custom term field the source for a marker?
This thread is resolved. Here is a description of the problem and solution.
Problem:
Maps – how to make a custom term field the source for a marker?
Solution:
The thing is that there is no way to display the term field under the "Fields" dropdown.
But workaround would be to create a taxonomy view in classic mode (taxonomy view does not supported in block mode) and add the marker shortcode where we can set the term field as source of the marker.
I have a custom post type “projects” with a taxonomy “countries”. The taxonomy “countries” has custom term fields. One custom term field is an address field, just for the country.
Now I want to show on a world map a marker for all available countries (the custom term field).
It is a view block and editing with the block editor.
But this term field is not available as the source for the marker. Available are only custom address fields of the custom post type “projects” but no custom term fields.
A workaround would be to assign all “projects” (hundreds) an additional address field. But it would be much more effective to pull in the custom term field of the related taxonomy (a few).
How to make a custom term address field a source for the marker?
Hello. Thank you for contacting the Toolset support.
Can you please share where exactly you would like to add the map using the custom term field as a source on what page/post and using what view?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hi Minesh, thank you very much for your help.
Yes, this works as expected. Great.
Also the filtering for the second taxonomy "program" works.
It works at least on the front end.
At the preview (block editor) back end no markers are shown on the world map.
And I am missing at the maps block the ability to create a pop-up block for the markers.
Could this also be done by some shortcodes in the loop editor of the view "display-marker-belongs-country" ??
At the preview (block editor) back end no markers are shown on the world map.
==>
Yes, this is expected, as we do not added the map marker using map block but using another view.
And I am missing at the maps block the ability to create a pop-up block for the markers.
==>
Whatever marker related changes you want you need to add it within the following view's loop output section, as the map marker is displayed from there.
- hidden link
For now, I've addded post title using shortcode [wpv-post-title] as marker popup content.
Hi Minesh. Great. You answered exactly what I need to know. Perfect.
Now I know where to work on the output and can try different ideas to work out.
Thanks again.
Have a nice rest of day. Greetings from Hamburg, Germany.
Kai Peter