Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Same Custom Field Used Multiple Times

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Ross Walsh
    #68955

    I want to make posts searchable by Prefectures and Districts in Japan. I can make one Field Group in ACF with two fields (prefectures and districts) and apply it to ALL posts and the search function would work. However, there are 47 prefectures and over 1700 districts in Japan which would mean (in theory) that I would have an incredibly long drop-down menu in the posts for the districts–something that is difficult to work with.

    To avoid this I created a field group for each prefecture in ACF which would have the same field name (districts) but the values would be different for each prefecture. So, for example, when I look at posts within the category “Tokyo” I would see A, B, C and when I look at posts with the category “Kanagawa” I would see D, E, F as options.

    This is fine, but when I created a search form based on the field name the options for checkbox only showed D, E, F (perhaps because that was the last field group I created).

    It seems the field values are not being merged. Is this a limitation with ACF or is there a work around for this with the Search & Filter plugin.

    Thank you in advance once again! I hope my question is clear.

    Trevor Moderator
    #68976

    I think it is an issue with ACF. It should not let you have a field ‘slug’ name that is already in use, as slug names are supposed to be unique in WordPress, within the use context that it is in (e.g. custom fields). They will almost certainly have an ID attached as well, which WILL be different. What S&F does is to find the first instance of a custom field type with that slugname and take those values.

    I have checked the ACF documentation to see if it is possible to cause one choice field to have its values filtered by an option chosen on another, and it is not (at least not without javascript on the editor page).

    Ross Walsh
    #68978

    Okay. I suspected that might be the case. Thank you for checking.

    Trevor Moderator
    #71952

    Can I close this thread?

    Ross Walsh
    #72263

    Yes, if I run into the problem again I will try and work out what change I made that resulted in the error.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Same Custom Field Used Multiple Times’ is closed to new replies.