I've built sandbox wesbite on Gutenberg and Kadence Theme In Toolset I've created custom post types with location that is displayed with custom marker on the map (color of marker depends on chosen custom post type taxonomy).
Example on website below hero section: hidden link
I wonder if displaying such a map is possible in Oxygen? If yes, how to do it? Is there any shortcode for this? How do I find it?
Kind regards,
Igor
Is there any documentation that you are following?
Notice the use of the ID "my-map", this will be used to link the marker shortcode to the map.
For the marker you will need to use the following shortcode.
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="wpcf-my-marker"]This is the content of the marker popup.[/wpv-map-marker]
Notice the map_id for the marker is the same as the map_id in the map render shortcode. Secondly the marker_field should contain the slug of your custom field keeping the "wpcf-" prefix.
Also given than you're using the has_term() function you will need to declare it in the Third Party Custom Functions section at Toolset->Settings -> Frontend and scroll to Third Party Custom Functions and add the function name.
Hi Shane, thanks for your reply. I did forget to register has_term function but after doing so I still can't see marker on the map. Please see attachments for debug and custom function.
Based on the debug data this expression evaluates down to (0 = 1) where has_term is returning false. This means the taxonomy is not apart of the post being viewed so the marker's code won't show up.
If this is not true then please provide me with admin access to the site so that I can check on this further for you.
I checked the page for you and what is happening is that you're checking if the current page has a specific term but this page doesn't even have a taxonomy assigned to it. Also there isn't any address on the page itself as well so no markers will be displaying.
Is it that you want to display the jobs on the homepage map ?
The easiest way to do this is to create a classic view and add the marker within that view. This view will provide the post data required for the markers to display.
If the classic view hasn't been enabled you can enable it by going to Toolset -> Settings and scrolling to Editing Experience. From there I recommend that you select " Show both the legacy and Blocks interface and let me choose which to use for each item I build".
This will allow you to have access to the classic editor as well as the block editor. From there refresh the page and go to Toolset -> Views.
From there you can use you conditional shortcode inside the views editor.
Once you've set things up in the view, you can add it to your template by using the view shortcode [wpv-view name='view-slug'] where you will replace view-slug with the actual slug of your view.
Hi Shane,
Thanks for checking my site and solving the problem! That's exactly what I wanted. I'm impressed with what toolset is able to do 🙂
I was even able to change clusters markers , thanks to this documentation: https://toolset.com/documentation/programmer-reference/maps/customizing-cluster-markers-with-javascript-functions/
Level of customization and references you guys providing is crazy.
And last but not least. Your support, Shane. Thank you very much for helping me out,
Igor