Saltar navegación

[Resuelto] Different Map Markers Per post Type

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

Display different map marker icon on post type.

Solution:

You can try [wpv-conditional] shortcode, like this:

https://toolset.com/forums/topic/different-map-markers-per-category/#post-2343707

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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 -

Zona horaria del colaborador: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por michaelB-49 4 years, 1 month ago.

Asistido por: Luo Yang.

Autor
Mensajes
#2339227

Tell us what you are trying to do?
Hi, I'm trying to use different map markers per category on this page right here:
enlace oculto

One is a PARK, one is a RESTAURANT.

Is there any documentation that you are following?
I've been trying to follow this, but not having any success:
https://toolset.com/forums/topic/different-map-markers/

Is there a similar example that we can see?
Yes, basically the same as what the ticket above was looking at.

What is the link to your site?
enlace oculto

Thank you!!!

#2339341

Hello,

Please provide a test site with the same problem, fill below private message box with test site credentials, also point out the problem page URL, I can setup a demo for you.

#2343707

I have done below modifications in your website:
Edit the problem page:
enlace oculto

1) find and select map block, in block setting panel, remove the marker setting, you can use below shortcode block to display the map markers

2) Find and select view block, add a shortcode block in view's loop, with below codes:

[wpv-conditional if="( '[wpv-post-type]' eq 'restaurant')"]
[wpv-map-marker map_id='Dallas-Fort-Worth-Map' marker_id='marker-[wpv-post-id]' marker_icon='//adventureswithmydog.com/wp-content/plugins/toolset-maps/resources/images/markers/Home.png' marker_field='wpcf-location-address'][wpv-post-link][/wpv-map-marker]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'park')"]
[wpv-map-marker map_id='Dallas-Fort-Worth-Map' marker_id='marker-[wpv-post-id]' marker_field='wpcf-location-address' marker_icon='//adventureswithmydog.com/wp-content/plugins/toolset-maps/resources/images/markers/Shop-2.png'][wpv-post-link][/wpv-map-marker]
[/wpv-conditional]

Above codes with check current post's post type value, and display different marker icon, you can change the "marker_icon" attribute value to other icon image URLs

More help:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

#2344703

All set and now have the code sample to use going forward too! Thanks Luo!!!!