Skip Navigation

[Resolved] How to Create a Layout with Dynamic Maps for a Places Custom Post Type?

This support ticket is created 5 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
- 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 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1270153

Hi,
I created a CPT called "Places", in which I intend create a post per place, for the places I want to show.
In the Place post, I want to show a map with a marker for that location, as well as other views related to that post.

My question is regarding creating a layout that has a map in it, and I need to input the marker location per post.
I tried to build a layout, but could not find a map block or option.
I could insert a visual editor, then add a map shortcode to it, but I would have thought that you have a better way to do so.

Also, I intend to fill the marker information using CSV import (using the plaugin called WPAllimport Pro).
I saw an article about specifying the marker source as "dynamic" and pick from a custom field.
My questions in this point are:
1- does this work with a layout template? (the article was for a single post).
2- if I have some places as an address, and some as coordinates, what's the best approach?

If there are any guidance regarding how to start this layout, I'd be very appreciative.

thanks a lot.

#1270163
map-block.JPG

Hello,

Q1) does this work with a layout template? (the article was for a single post).
Yes, you are right, there isn't Map cell or marker cell within Layouts plugin, see our document:
https://toolset.com/documentation/user-guides/layout-editor-cells/

So, you can setup a visual editor cell or content template cell, and display the Map shortcode + Marker shortcodes, it is the same result.

And there is a map block within Toolset Blocks plugin, you can download it here:
https://toolset.com/account/downloads/

You can use it to setup a Toolset Map block, and use your custom address field as the marker's Dynamic source, see screenshot map-block.JPG.

Q2) if I have some places as an address, and some as coordinates, what's the best approach?

I assume we are talking about a custom address field created with Toolset Types + Maps plugins.
If it is, the custom address fields requires input address in text format, in your case, you can try these:
1) Add two other custom numeric fields:
- Latitude
- Longitude

2) In your layout, create a visual editor cell, and display the map + marker shortcodes.
use above two custom numeric fields, as the source of marker shortcodes, for example:

<p>[wpv-map-render map_id="map-3"][/wpv-map-render]</p>
<p>&nbsp;</p>
<p>[wpv-map-marker map_id='map-3' marker_id='marker-2' lat='[types field='latitude' output='raw'][/types]' lon='[types field='longitude' output='raw'][/types]'][/wpv-map-marker]</p>