Skip Navigation

[Resolved] Address Field Best Practices

This thread is resolved. Here is a description of the problem and solution.

Problem:

Is there documentation regarding best practices for creating address fields?

Solution:

I suggest you try these:

1) Follow our document to setup a custom address field

https://toolset.com/course-lesson/installing-toolset-maps-and-adding-address-fields/

2) Filter and order the results by distance:

https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/

Relevant Documentation:

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

Last updated by mikeS-32 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1728795

Is there documentation regarding best practices for creating address fields? I'm not yet ready to incorporate mapping features, but might want to do that in the future. Should the fields be grouped in some way? What do I need to consider now if I want to map in the future? Initially I will be doing the data input when I create the custom post.

I've searched the Toolset site and Google but I have only found bits and pieces of an answer.

FWIW, I am attempting to use WP/Toolset as a CMS and my custom posts will provide information about the photos and documents in my family archive. Ultimately, I'd like to have the visitors to the site be able to sort by people, dates, locations, events, etc. By the way, if anyone else is doing this I'd love to brainstorm with you!

Thanks,

Mike

#1729059

Hello,

Yes, it is possible to search and order the result by address distance.

I suggest you try these:
1) Follow our document to setup a custom address field
https://toolset.com/course-lesson/installing-toolset-maps-and-adding-address-fields/

2) Filter and order the results by distance:
https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/

#1729729

Thanks for the quick response Luo.

I had seen the two links that you reference. What I am trying to get my head around as I design my custom fields is that in Toolset there is just one field for the entire address AND it is related to setting up the Mapping API. I have not programmed professionally for decades, but back in the day we'd have individual fields for each part of the address and they'd be arranged in a hierarchy and often grouped together into sub-components of the address. There might be individual fields for city, state, zip, etc, but the street address might be a group composed of number, name, and road type.

Now it seems that all that parsing is done either by Google or Toolset and somehow, magically, your tools will get at the individual components of the address to sort and filter. As I said in my initial message, I'm don't want to use mapping initially. But it seems like I should just go with the flow set up the API anyway so that I can use the address field for sorting and filtering via Toolset's features. I don't want to do anything particularly fancy, I just want to be able to filter my custom posts by street name or state.

So, bottom line, should I just use the Address Block and API or create separate fields for those components that I want to sort and filter by? I suppose another question is do I have to set up the API to use the Address block?

Thanks again.

Mike

#1730063

Luo,

I'm going to punt and close this out. Upon further investigation and playing around, I am going to get a Google API key to enable me to use the Toolset Address field, and then just not worry about mapping for the time being. I will also create a couple of custom fields for the street address and city so that I can hopefully use Toolset to sort on those individual fields.

As I suspected the Google API is a bit of a pain to configure (I'm currently getting Javascript errors when I try to display a map) and I imagine it will be a bit of a pain to maintain in my particular situation as I am using localhost and plan on having many duplicates of my project, some of which will be standalone apps without Internet connectivity.

Thanks for your effort.

>>>>Mike

#1730065

My issue is resolved now. Thank you!

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