Passer la navigation

[Résolu] Highlighting a single map icon

This support ticket is created Il y a 4 years. 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 -

Fuseau horaire du supporter : Asia/Karachi (GMT+05:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par marcH-4 Il y a 4 years.

Assisté par: Waqar.

Auteur
Publications
#2368357

Tell us what you are trying to do?
Highlight a single map icon

Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

Is there a similar example that we can see?
lien caché
See how the icon is highighted compared to the others (I do not want to click to highlight)

What is the link to your site?
lien caché

#2369161

Hi,

Thank you for contacting us and I'd be happy to assist.

It is possible to set a different map marker icon for an individual map marker using the "marker_icon" attribute, in the "wpv-map-marker":
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

If you don't want to link it with the 'click' event, can you please share information about selecting the highlighted map marker? I'll be in a better position to guide you, accordingly.

regards,
Waqar

#2369173

Hi, my page uses a content template which shows a single CPT listing. Within that template i have a view which shows several listings from the same CPT. How do I pull the ID of the single listing into the view to differentiate the map icon from all the others

#2369479

Thanks for writing back.

You can check the option "Don't include current page in query result" in the view's "Query Options", which will exclude the marker from the current post from showing.

Next, you can include a separate instance of the "wpv-map-marker" shortcode with a different/special marker icon, for the current post in the template directly, so that it is not in the view's loop.

This way, the results from the view will show the map markers with the default marker icon, while the map marker for the current post will show with a different/special marker icon.

#2371921

My issue is resolved now. Thank you! Your solution worked perfectly, and allowed me to continue.