Skip Navigation

[Resolved] Maps – how to make a custom term field the source for a marker?

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

Problem:
Maps – how to make a custom term field the source for a marker?

Solution:
The thing is that there is no way to display the term field under the "Fields" dropdown.

But workaround would be to create a taxonomy view in classic mode (taxonomy view does not supported in block mode) and add the marker shortcode where we can set the term field as source of the marker.

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/maps-how-to-make-a-custom-term-field-the-source-for-a-marker/#post-2052971

Relevant Documentation:

This support ticket is created 3 years, 6 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 7 replies, has 2 voices.

Last updated by kai-peterW 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2050887

I have a custom post type “projects” with a taxonomy “countries”. The taxonomy “countries” has custom term fields. One custom term field is an address field, just for the country.

Now I want to show on a world map a marker for all available countries (the custom term field).
It is a view block and editing with the block editor.

But this term field is not available as the source for the marker. Available are only custom address fields of the custom post type “projects” but no custom term fields.

A workaround would be to assign all “projects” (hundreds) an additional address field. But it would be much more effective to pull in the custom term field of the related taxonomy (a few).

How to make a custom term address field a source for the marker?

#2051415

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please share where exactly you would like to add the map using the custom term field as a source on what page/post and using what view?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2052971

Minesh
Supporter

Languages: English (English )

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

The thing is that there is no way to display the term field under the "Fields" dropdown.

But workaround would be, i've created the following view that query the taxonomy Country:
=> hidden link

And within this taxonomy view's loop editor , i've added the marker shortcode as given under:

<wpv-loop>
          [wpv-map-marker map_id='map-3' marker_id='marker-[wpv-post-id]' marker_termmeta='wpcf-country-google-address'][/wpv-map-marker]
</wpv-loop>

And then added the above view using the shortcode block within your block view:
=> hidden link

[wpv-view name="display-marker-belongs-country"]

Can you please check now: hidden link

Can you please confirm it works as expected.

#2053027

Hi Minesh, thank you very much for your help.
Yes, this works as expected. Great.
Also the filtering for the second taxonomy "program" works.
It works at least on the front end.

At the preview (block editor) back end no markers are shown on the world map.
And I am missing at the maps block the ability to create a pop-up block for the markers.

Could this also be done by some shortcodes in the loop editor of the view "display-marker-belongs-country" ??

Have a nice day.

Regards,

Kai Peter

#2053033

Minesh
Supporter

Languages: English (English )

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

At the preview (block editor) back end no markers are shown on the world map.
==>
Yes, this is expected, as we do not added the map marker using map block but using another view.

And I am missing at the maps block the ability to create a pop-up block for the markers.
==>
Whatever marker related changes you want you need to add it within the following view's loop output section, as the map marker is displayed from there.
- hidden link

For now, I've addded post title using shortcode [wpv-post-title] as marker popup content.

 [wpv-map-marker map_id='map-3' marker_id='marker-[wpv-post-id]' marker_termmeta='wpcf-country-google-address']
          		[wpv-post-title]
          [/wpv-map-marker]

Whatever you want to display as marker popup youo should add it where I've added the [wpv-post-title]shortcode.

#2053095

Hi Minesh. Great. You answered exactly what I need to know. Perfect.
Now I know where to work on the output and can try different ideas to work out.
Thanks again.

Have a nice rest of day. Greetings from Hamburg, Germany.
Kai Peter

#2053099

Minesh
Supporter

Languages: English (English )

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

Glad to know that the solution I shared help you to resolve your issue. You are welcome to mark resolve this ticket.

#2053153

My issue is resolved now. Thank you!