Forums › Forums › Search & Filter Pro › ACF city-selector field plugin
- This topic has 25 replies, 2 voices, and was last updated 4 years, 11 months ago by
Trevor.
-
Anonymous(Private) June 9, 2020 at 5:35 pm #248090
Hi,
I am using a Country/Region/City extension for Advanced Custom Fields. It creates an ACF field type called ‘City selector’.
link plugin https://github.com/Beee4life/acf-city-selector
This is supposed to display on the UI in 3 seperate tabs.For example, when adding a post about a location:
The first tab displays all Countries. The user can then select a Country.
The second tab then displays all Regions in the selected Country. The user can select one.
The third tab then displays all Cities in the selected Region. The user can select one.This worrks perfectly in my front-end-forn and in the backend (post add / edit).
I have also included this field in a S&F Pro form, as a ‘Post-Meta’ field, to filter the posts in a post archive layout. The filter works correctly BUT all Countries/Regions/Cities are shown in a single dropdown. This isn’t user friendly.
I’m not a developer and I don’t have the ability to write php code, so I need your assistance to make this filter display properly. I can send screenshots and a link to the city-selector documentation if necessary.
Trevor(Private) June 9, 2020 at 5:40 pm #248093I think the extra (third party?) ACF plugin uses a repeater field, where it has all three fields in one ‘row’. Our plugin cannot work with this, sorry. You need to make 3 separate ‘normal’ fields which are Countries, Regions and Cities.
When you use them in posts, as long as you set our form up correctly, our form will link them together. To do this, in the General settings tab of the form:
Set
Auto Count
(both settings) toON
And then in the Form UI:
In each field set
Hide Empty
toON
Anonymous(Private) June 9, 2020 at 9:03 pm #248116I see that you previously suggested that you solve this problem with save_post+add_action
, whether it still works
https://support.searchandfilter.com/forums/topic/acf-city-selector-field/Trevor(Private) June 9, 2020 at 9:09 pm #248124If you create these extra fields, you can get help on the calculated fields help on the ACF forums. You would have to write the code though. This post shows an example, but the guys at ACF should be able to give better examples:
https://support.searchandfilter.com/forums/topic/datefilter/page/3/#post-238869
-
AuthorPosts