Skip Navigation

[Resolved] Give post type a specific marker and display on map main map.

This support ticket is created 5 years, 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by antonioR-4 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1450109

Tell us what you are trying to do?

I am trying to give a post type a specific map marker depending on a value from a custom field. I have a "Select" custom field where I have two options. When choosing option 1, I want that to be a marker. When choosing option 2, I want that to be another marker.

Is there any documentation that you are following?

This looks like something I want to do: https://toolset.com/forums/topic/different-custom-marker-in-a-map-based-on-a-custom-taxonomy/

But I only want 2 markers depending on what value I choose when editing the custom post type.

Is there a similar example that we can see?

What is the link to your site?

hidden link

#1450333

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand (considering you are using views plugin), you want to display two different marker pins based on the custom select field value set to the specific post.

so, if the post having option 1 set display X marker icon and if the post having option 2 set display Y marker icon. If this is true?
- You can display different marker icons using the [wpv-conditional] shortcode.

For example:

[wpv-conditional if="( '[types field="your-field-slug"][/types]'eq '1')"]
      // add your marker with marker icon X
  [/wpv-conditional]
       
[wpv-conditional if="(  '[types field="your-field-slug"][/types]' eq '2')"]
     // add your marker with the marker icon Y
[/wpv-conditional]

Where:
- Adjust the value of your field slug and its associated value.

More info:
=> https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/#checking-types-plugin-shortcodes
=> https://toolset.com/documentation/user-guides/maps/display-on-google-maps/displaying-markers-on-google-maps/#displaying-a-map-with-a-list-of-markers-coming-from-a-view

Please let me know if this is not the case and your requirement is different, please feel free to correct me.

#1450843

Thank you, this helped.

Only thing missing was that I had followed the Toolset guide in a way that I had created a Content Template to display markers. This was not mentioned in the reply but I figured it out.

Thank you!