Skip Navigation

[Resolved] I want to display a mpa, using multiple, non-address fields.

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

Last updated by Ed 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1278299

Ed

I have some custom fields set up (Street Address, Mailing Address, City, State, Zip Code). If the listing has an actual street address, I want to display a map (not a problem, because I have a "Full Address" field). However, there are listings with only a PO Box, that still need a map (using City, State, and Zip Code).

If a listing has an actual street address, the Full Address (including street address, city, state, and zip) field will be populated.

When a listing only has a PO Box, I want to use the City, State, and Zip Code fields to create the map.

How can this be done, if at all?

#1278371

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You can display the marker conditionally by checking the field is empty or not.

I think you should add the [wpv-conditional] shortcode to check your field value and based on that add marker shortcode:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

If you do not know how to do it - please share problem URL and access details and I will check and add the conditional marker for you.

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

#1278375

Ed

Yes, I'm aware of conditional display and I'm currently using that. My problem isn't whether or not or which map to display. My problem is being able to display a map, using fields that aren't "address" fields (single line fields, for City, State, and Zip Code).

#1278379

Minesh
Supporter

Languages: English (English )

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

Yes - I know and I understand that.

You should try to add the map marker with combination of different Types fileds as given under:

[wpv-map-marker map_id='map-2' marker_id='marker-[wpv-post-id]' address="[types field='field-1'][/types] [types field='field-2'][/types][types field='field-'][/types]"][/wpv-map-marker]

Where:
- You should change the map_id as required.

#1278383

Ed

Ah! The "address" attribute! That's what I was looking for! I'm going to try this.

Thanks, Minesh!

#1278385

Minesh
Supporter

Languages: English (English )

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

Great - it should work. Feel free to resolve the ticket once you see its working 🙂

#1278409

Ed

My issue is resolved now. Thank you!