Hi,
I have a custom post type which has a taxonomy with a custom Address field. I have a view to filter on the post types and need a map to display the addresses of the terms of the selected posts (one address for each post).
The view works but I have trouble with the map. I understand I need the legacy editor as it can't be done in blocks yet. I created a taxonomy view with the query filter set to "Select taxonomy terms whose parent is the value set by the parent view.".
I don't know how to proceed. All courses (https://toolset.com/course-lesson/) I read so far are with the block editor only. The programmer reference (https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/) is useful but I miss complete examples, with all the steps and markup explained. Where can I find that?
Hello,
Please share your website credentials in below private message box, also point out the problem page URL and view URLs, I need to test it in a live website, thanks
Hi Luo,
Issue 1:
The custom post type Activities is using the taxonomy TaxLocations1, which has an Address field called "Where is it".
The frontend page is hidden link. The view shows the Activities and allows filtering on the taxonomy. That works fine. Under Toolset - Views I have created the view "Locations from tax all results". I'm using this in the "Fields and Text" block in the view loop.
I need a full example on how to proceed to display the addresses on a map. I was only able to find examples based on an address field in the post rather than the taxonomy, and it's all blocks based. Where are the legacy examples that I need for stuff like this? Step by step with the full markup, that would be really helpful.
Issue 2:
The view shows buttons that link to the individual Activity posts. The template for a single Activity includes a map. This basically works, but for 1 out of 3 activities it shows the wrong location: it points to Geneva in the USA but I manually selected a location in Geneva Switzerland. Please see the screenshots.
Many thanks!
Arno
Thanks for the details, I can login into your website, will update here if find anything
I have done below modifications in your website:
1) Edit the taxonomy view "Locations from tax all results":
hidden link
- Change the filter to:
Taxonomy is set by the current post
- In view's loop, display the marker shortcode as below:
[wpv-map-marker map_id='map-21' marker_id='marker-[wpv-taxonomy-id]' marker_termmeta='wpcf-where-is-it'][wpv-taxonomy-link][/wpv-map-marker]
2) Edit the problem page
hidden link
Display the map shortcode as below:
[wpv-map-render map_id="map-21"][/wpv-map-render]
Test it in frontend:
hidden link
It works fine,
3) Edit the content template "Template for Activities"
hidden link
Replace the map block with above taxonomy view shortcode + map shortcode:
[wpv-view name="locations-from-tax-all-results"]
[wpv-map-render map_id="map-21"][/wpv-map-render]
Test it in frontend:
hidden link
It works fine too, please check if it is fixed, thanks
Thanks a lot. That works fine and I understand the concept. I would not have been able to figure this out myself. I didn't know that basically all data selection and even the map ID selection is done in the legacy taxonomy view. Once all of that works, it's only a matter of using the right short codes on-page. The markup for wpv-map-marker makes sense when seeing it, but it's hard to come up with that for Toolset beginners.
So there is no documentation?
Will all of this be easier, and blocks based, in the future? And when?
Thanks again!
The document for classic editor was removed, and replaced with Blocks editor, we are improving features of Blocks editor, but there isn't any ETA for it, currently, please follow our document to setup the map and marker shortcodes:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/
Ok, thanks, I will submit new threads if the programmer reference is not clear.