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
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
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 )
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
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.
Hi Waqar
No the new update broke everything so I'm trying to fix that. I'll try it later on and update this
Please take your time and let me know if you have any follow-up questions.
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
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 )