Support

Account

Home Forums Feature Requests Option Relationships

Solving

Option Relationships

  • Would it be possible to create a relationship between field groups where by you can have a static set of options used on multiple options pages and field groups?

    For example.
    I have a list of places in a dropdown, lets say the following.
    Countries:
    – Canada
    – United States
    – Europe

    However, I have multiple options pages (and other field groups as well) that require the use of “Countries”.

    To my understanding, currently the only way to use this is to create a countries section for each field group i generate, and am unable to maintain a singular list.
    As you could see, this would pose a problem if i were to ever want to update the countries list as i would have to change them in multiple places.

    If there is a way to do this, could you please point me in the right direction? Thanks!

  • An easy way i can see this working is to add an option to the relationship field to incorporate other field groups. Once the relationship is added, it will be available within that field group and inherit the same settings as its parent group.

  • Hi @Epik

    Thanks for the feedback. Yes some sort of ‘clone’ or ‘ditto’ field would be awesome, and I hope to add one in soom.

    For the time being, I would create a select field in each field group called ‘counties’, but I would not add in any choices.

    Use a filter to hook into the field and populate the select field choices dynamically. This means all your country fields will load the choices from some PHP. And you can then store all your country data in PHP, or even a json file.

    Checkout this article to learn more:
    http://www.advancedcustomfields.com/resources/tutorials/dynamically-populate-a-select-fields-choices/

    Thanks
    E

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

The topic ‘Option Relationships’ is closed to new replies.