Skip Navigation

[Resolved] Maps in search

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 8 replies, has 2 voices.

Last updated by Waqar 8 months ago.

Assisted by: Waqar.

Author
Posts
#2632725

Tell us what you are trying to do?
I have a map in search that is displaying markers based on the search view. 1 of the search fields (locations) is a relationship linked to rooms in that location. I would like to use the address field of the location as the displayed location there doesn't seem to be a way to select it to display. I also need to use the location name in the marker popup but it also doesnt seem to be working

the location is here hidden link

#2632869

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

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

I tried to view the page that you shared, but it is showing the 'page not found' message.

To suggest the next steps, I'll need to see how these fields and the view are set up in the admin area. Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2634477

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the access details.

Sorry about the delay in getting back, as we had an unusually busy forum queue, after the weekend.

During troubleshooting, I noticed that the 'Map' block was used in a way that the marker settings were also added through that block.

I've disabled the marker settings from that block and instead added the shortcode for the map marker, in the last 'Fields and Text' block used in the view:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker
( screenshot: hidden link )


[wpv-map-marker map_id='map-3' marker_id='marker-[wpv-post-id]' marker_field='wpcf-suite-address'][wpv-post-title][/wpv-map-marker]

And in the map block's settings, I've also enabled the 'Spiderfy overlapping markers' option, so that for the closely located markers, an individual marker is always shown, without overlapping.
( screenshot: hidden link )

#2635081

this field isn't the relationship one though, we need the address of the building that the suite is attached to. thats address of buildings field which has the relationship
unless I'm missing something the suite address you've put there is the same as what was already there

#2635703

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

I tried to log in to the website's admin area, but that user seems to have been removed.

Before I made the changes, the map markers were showing from the different fields, or at least the map marker details were showing from the locations and not from the suites/rooms.

As a general rule, the marker shortcode will not need the 'item' attribute, if you'd like to target the address field from the same post type whose view is being used:


[wpv-map-marker map_id='map-3' marker_id='marker-[wpv-post-id]' marker_field='wpcf-suite-address'][wpv-post-title][/wpv-map-marker]

But, if you need to call the field from the related parent post type, the item attribute will be needed:


[wpv-map-marker map_id='map-3' marker_id='marker-[wpv-post-id]' marker_field='wpcf-address-field' item='@{relationship-slug}.parent'][wpv-post-title item='@{relationship-slug}.parent'][/wpv-map-marker]

Where you'll replace 'address-field' and '{relationship-slug}' with the target field's slug and the target relationship slug, respectively.

#2635705

Hi Waqar

No the new update broke everything so I'm trying to fix that. I'll try it later on and update this

#2635719

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Please take your time and let me know if you have any follow-up questions.

#2637283

I tried the 2nd option but i cant seem to make it work, not sure if I am missing something...
I've updated the login info as well

#2637411

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

The shortcode for the map marker was correct, but it was placed outside the loop of the view.
( before screenshot: hidden link )

I've dragged it inside the loop and the map markers are showing now.
( after screenshot: hidden link )

#2637467

thanks that worked 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.