Skip Navigation

[Resolved] Different Markers in a map is not working

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is trying a solution that uses conditional shortcodes to display different custom markers on a map depending on the category, but it is not working.

Solution:
In this case the conditional shortcodes are testing "categories" but should actually be testing a custom taxonomy instead, and updating the code to use the correct custom taxonomy resolves the problem.

Relevant Documentation:
The solution being used is described here: https://toolset.com/forums/topic/different-marker-image-in-a-single-map/

This support ticket is created 5 years, 5 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by kaiD 5 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1274193
FireShot Capture 040 - View bearbeiten ‹ ADP Woo Commerce Entwicklung — WordPress_ - aufdenpunkt.digital.png
FireShot Capture 039 - Map Beispiel - ADP Woo Commerce Entwicklung - aufdenpunkt.digital.png
FireShot Capture 038 - Inhalts-Template bearbeiten ‹ ADP Woo Commerce Entwicklung — WordPres_ - aufdenpunkt.digital.png
FireShot Capture 037 - Einstellungen ‹ ADP Woo Commerce Entwicklung — WordPress_ - aufdenpunkt.digital.png

I am trying to: I´m trying to do the same as descripted here: https://toolset.com/forums/topic/different-marker-image-in-a-single-map/

What I´ve done already:
- I´ve created a new post type with toolkit called: Stationen
- For that post type i´ve created 3 different categories: buehnen, flaschenrueckgabe, stationen
- Also i implemented a adress field
- So i´ve got 3 different posts, with different adresses
- I´ve uploaded 3 different icon markers in the media folder
- I´ve created a view (Stationen 2) to show the markers on the map (in the first place just in the regular way, so that every post has the same icon marker; that worked fine)
- I´ve included Functions inside conditional evaluations" - has_term
- I´ve created a content template with the code you´ve posted. In that i changed the categories names to my own and also the url to the urls where the icons can be found.
- I´ve created a dummy site where i put the shortcode for the view in (hidden link) View (Stationen 2).

Link to a page where the issue can be seen:hidden link

I expected to see: Like in your example i´ve expected to see 3 different markers. For each post adress a different one.

Instead, I got: Just the map with no markers

#1274247

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I looked at your site and notice that your taxonomy for station categories is "stationskategorie", but in the content template where you use the has_term function you specify "categories" as the taxonomy.

I changed those to "stationskategorie" and it now appears to work.

#1274395

Hi Nigel,

thanks for the quick support. Works fine now.
Have a nice day!

Kai