Home › Toolset Professional Support › [Resolved] creating map from uses where address is several user meta fields
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 11 replies, has 2 voices.
Last updated by Steve 1 year, 11 months ago.
Assisted by: Minesh.
Im trying to build a map of a certain level of users in out site. The addresses are in meta fields created by our membership plugin
Ive set up the map marker like this
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_title='[wpv-post-title]' marker_usermeta='pmpro_baddress1, pmpro_bcity, pmpro_bstate, pmpro_bzipcode'][wpv-post-title]
[/wpv-map-marker]
But its not returning any results have I set this up correctly?
Hello. Thank you for contacting the Toolset support.
What if you try to use the [wpv-post-field] shortcode to get the value of your third-party plugin custom field.
For example:
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_title='[wpv-post-title]' marker_usermeta='[wpv-post-field name="pmpro_baddress1"], [wpv-post-field name="pmpro_bcity"], [wpv-post-field name="pmpro_bstate"], [wpv-post-field name="pmpro_bzipcode"]'][wpv-post-title] [/wpv-map-marker]
More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153444
Thanks Minesh, but no luck there
If i make a simple view with those shortcodes
<wpv-loop>
Iget the display name but no values in the others
ahh - I would like to know the custom fields you are using (pmpro_baddress1, pmpro_bcity, pmpro_bstate, pmpro_bzipcode) those are post custom fields or user custom fields?
They are user fields Minesh- sorry if i wasn't clear
Can you please share edit page screenshot of your view - that will help me to clear most of the things.
Yes sure, its attached
I see you are using the user type view. To get the related user information you will have to use the shortcode [wpv-user]:
=> https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user
Can you please try to use the following shortcode and check if that help you to resolve your issue:
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-user field="ID"]' marker_title='[wpv-user field="user_login"]' marker_usermeta='[wpv-user field="pmpro_baddress1"], [wpv-user field="pmpro_bcity"], [wpv-user field="pmpro_bstate"], [wpv-user field="pmpro_bzipcode"]'] [wpv-user field="user_login"] [/wpv-map-marker]
Minesh my simple view now works so the wpv-user field="" shortcode is correct and the field names are correct
[wpv-items-found]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
However my view to create the map still shows no markers is there something else i may have missed? Thanks
[wpv-items-found]
[wpv-map-render map_id="map-1" map_height="450px"][/wpv-map-render]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-user field="ID"]' marker_title='[wpv-user field="user_login"]' marker_usermeta='[wpv-user field="pmpro_baddress1"], [wpv-user field="pmpro_bcity"], [wpv-user field="pmpro_bstate"], [wpv-user field="pmpro_bzipcode"]']
[/wpv-map-marker]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
Can you please share problem URL where you added your view and admin access details.
*** 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. I have set the next reply to private which means only you and I have access to it.
Can you please check now: hidden link
You do not need two views. So I've deleted the [wpv-view name="chapters-map"] shortcode block from the following page:
=> hidden link
As you can see now it only have one shortcode block with view's shortcode: [wpv-view name="list-chapters"]
Now, with the view "list-chapters", I've added the map shortcode outside the view's loop and marker shortcode within the loop as given under:
=> hidden link
[wpv-layout-start] [wpv-items-found] [wpv-map-render map_id="map-1" map_height="450px"][/wpv-map-render] <ul> <!-- wpv-loop-start --> <wpv-loop> [wpv-map-marker map_id='map-1' marker_id='marker-[wpv-user field="ID"]' marker_title='[wpv-user field="user_login"]' address='[wpv-user field="pmpro_baddress1"], [wpv-user field="pmpro_bcity"], [wpv-user field="pmpro_bstate"], [wpv-user field="pmpro_bzipcode"]'] [/wpv-map-marker] <li>[wpv-user field="display_name"]- [wpv-user field="user_login"]-[wpv-user field="user_firstname"]| [wpv-user field="pmpro_baddress1"], [wpv-user field="pmpro_bcity"], [wpv-user field="pmpro_bstate"], [wpv-user field="pmpro_bzipcode"]</li> </wpv-loop> </ul> <!-- wpv-loop-end --> [/wpv-items-found] [wpv-no-items-found] <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong> [/wpv-no-items-found] [wpv-layout-end]
The difference is I've added the "address" attribute to display the map address as you can see above with marker shortcode:
address='[wpv-user field="pmpro_baddress1"], [wpv-user field="pmpro_bcity"], [wpv-user field="pmpro_bstate"], [wpv-user field="pmpro_bzipcode"]'
Can you please confirm now it works as expected.
My issue is resolved now. Thanks for your help